Package bftsmart.communication.server
Class ServerConnection
- java.lang.Object
-
- bftsmart.communication.server.ServerConnection
-
public class ServerConnection extends java.lang.Object
This class represents a connection with other server. ServerConnections are created by ServerCommunicationLayer.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
ServerConnection.ReceiverThread
Thread used to receive packets from the remote server.protected class
ServerConnection.TTPReceiverThread
Thread 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.SecretKey
getSecretKey()
Tulio A.protected void
reconnect(javax.net.ssl.SSLSocket newSocket)
(Re-)establish connection between peers.void
send(byte[] data)
Used to send packets to the remote server.void
shutdown()
Stop message sending and reception.void
ssltlsCreateConnection()
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.InterruptedException
Used 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
-
-