public class ServerConnection
extends java.lang.Object
Modifier and Type | Class and 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.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MAC_ALGORITHM |
protected java.util.concurrent.LinkedBlockingQueue<byte[]> |
outQueue |
Constructor and Description |
---|
ServerConnection(ServerViewController controller,
java.net.Socket socket,
int remoteId,
java.util.concurrent.LinkedBlockingQueue<SystemMessage> inQueue,
ServiceReplica replica) |
Modifier and Type | Method and Description |
---|---|
void |
authenticateAndEstablishAuthKey() |
javax.crypto.SecretKey |
getSecretKey() |
protected void |
reconnect(java.net.Socket newSocket)
(Re-)establish connection between peers.
|
void |
send(byte[] data,
boolean useMAC)
Used to send packets to the remote server.
|
void |
shutdown()
Stop message sending and reception.
|
public static final java.lang.String MAC_ALGORITHM
protected java.util.concurrent.LinkedBlockingQueue<byte[]> outQueue
public ServerConnection(ServerViewController controller, java.net.Socket socket, int remoteId, java.util.concurrent.LinkedBlockingQueue<SystemMessage> inQueue, ServiceReplica replica)
public javax.crypto.SecretKey getSecretKey()
public void shutdown()
public final void send(byte[] data, boolean useMAC) throws java.lang.InterruptedException
java.lang.InterruptedException
protected void reconnect(java.net.Socket newSocket)
newSocket
- socket created when this server accepted the connection
(only used if processId is less than remoteId)public void authenticateAndEstablishAuthKey()