Interface SocketFactoryCallback


public interface SocketFactoryCallback
Interface for user defined creation of sockets, towards NCS/Confd
  • Method Details

    • getUnconnectedSocket

      Socket getUnconnectedSocket(Object caller) throws IOException, ConfException
      Retrieve an unconnected socket. Such socket can be used when e.g a bind() call is necessary before the connect() is performed. The connect() call is performed by the requestor.
      Parameters:
      caller - The requestor object instance
      Returns:
      An unconnected socket
      Throws:
      IOException
      ConfException
    • getSocket

      Socket getSocket(Object caller, Socket s)
      Retrieve a connected socket using a connected socket as basis. The default implementation of this method will just return the given socket in the argument.
      Parameters:
      caller - The requestor object instance
      s -
      Returns:
      the resulting socket
    • getSocket

      Socket getSocket(Object caller, String hostname, int port) throws IOException, ConfException
      Retrieve a connected socket to a specified destination
      Parameters:
      caller - The requestor object instance
      hostname - The preferred host
      port - The preferred port
      Returns:
      the socket connected to hostname, port
      Throws:
      IOException
      ConfException
    • getSocket

      Socket getSocket(Object caller, InetAddress iaddr, int port) throws IOException, ConfException
      Retrieve a connected socket to a specified destination
      Parameters:
      caller - The requestor object instance
      iaddr - The preferred address
      port - The preferred port
      Returns:
      the socket connected to iaddr, port
      Throws:
      IOException
      ConfException