Class ServerConnection


  • public class ServerConnection
    extends java.lang.Object
    This class represents a connection with other server. ServerConnections are created by ServerCommunicationLayer.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.concurrent.LinkedBlockingQueue<byte[]> outQueue  
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • outQueue

        protected java.util.concurrent.LinkedBlockingQueue<byte[]> outQueue
    • 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