Package com.tailf.conf
Interface SocketFactoryCallback
public interface SocketFactoryCallback
Interface for user defined creation of sockets, towards NCS/Confd
-
Method Summary
Modifier and TypeMethodDescriptionRetrieve a connected socket to a specified destinationgetSocket
(Object caller, InetAddress iaddr, int port) Retrieve a connected socket to a specified destinationRetrieve a connected socket using a connected socket as basis.getUnconnectedSocket
(Object caller) Retrieve an unconnected socket.
-
Method Details
-
getUnconnectedSocket
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
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 instances
-- Returns:
- the resulting socket
-
getSocket
Retrieve a connected socket to a specified destination- Parameters:
caller
- The requestor object instancehostname
- The preferred hostport
- The preferred port- Returns:
- the socket connected to hostname, port
- Throws:
IOException
ConfException
-
getSocket
Retrieve a connected socket to a specified destination- Parameters:
caller
- The requestor object instanceiaddr
- The preferred addressport
- The preferred port- Returns:
- the socket connected to iaddr, port
- Throws:
IOException
ConfException
-