Package bftsmart.communication.server
Class ServerConnection
- java.lang.Object
-
- bftsmart.communication.server.ServerConnection
-
public class ServerConnection extends java.lang.ObjectThis class represents a connection with other server. ServerConnections are created by ServerCommunicationLayer.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classServerConnection.ReceiverThreadThread used to receive packets from the remote server.protected classServerConnection.TTPReceiverThreadThread used to receive packets from the remote server.
-
Field Summary
Fields Modifier and Type Field Description protected java.util.concurrent.LinkedBlockingQueue<byte[]>outQueue
-
Constructor Summary
Constructors Constructor Description ServerConnection(ServerViewController controller, javax.net.ssl.SSLSocket socket, int remoteId, java.util.concurrent.LinkedBlockingQueue<SystemMessage> inQueue, ServiceReplica replica)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.crypto.SecretKeygetSecretKey()Tulio A.protected voidreconnect(javax.net.ssl.SSLSocket newSocket)(Re-)establish connection between peers.voidsend(byte[] data)Used to send packets to the remote server.voidshutdown()Stop message sending and reception.voidssltlsCreateConnection()Deal with the creation of SSL/TLS connection.
-
-
-
Constructor Detail
-
ServerConnection
public ServerConnection(ServerViewController controller, javax.net.ssl.SSLSocket socket, int remoteId, java.util.concurrent.LinkedBlockingQueue<SystemMessage> inQueue, ServiceReplica replica)
-
-
Method Detail
-
getSecretKey
public javax.crypto.SecretKey getSecretKey()
Tulio A. Ribeiro.- Returns:
- SecretKey
-
shutdown
public void shutdown()
Stop message sending and reception.
-
send
public final void send(byte[] data) throws java.lang.InterruptedExceptionUsed to send packets to the remote server.- Throws:
java.lang.InterruptedException
-
reconnect
protected void reconnect(javax.net.ssl.SSLSocket newSocket)
(Re-)establish connection between peers.- Parameters:
newSocket- socket created when this server accepted the connection (only used if processId is less than remoteId)
-
ssltlsCreateConnection
public void ssltlsCreateConnection()
Deal with the creation of SSL/TLS connection. Author: Tulio A. Ribeiro
-
-