Package org.jgroups.util
Class DefaultSocketFactory
java.lang.Object
org.jgroups.util.DefaultSocketFactory
- All Implemented Interfaces:
SocketFactory
Default implementation, ignores service names
- Author:
- Bela Ban
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> Tvoidclose(DatagramSocket sock) voidclose(ServerSocket sock) voidcreateDatagramSocket(String service_name) createDatagramSocket(String service_name, int port) createDatagramSocket(String service_name, int port, InetAddress laddr) createDatagramSocket(String service_name, SocketAddress bindaddr) createMulticastSocket(String service_name) createMulticastSocket(String service_name, int port) createMulticastSocket(String service_name, SocketAddress bindaddr) createServerSocket(String service_name) createServerSocket(String service_name, int port) createServerSocket(String service_name, int port, int backlog) createServerSocket(String service_name, int port, int backlog, InetAddress bindAddr) createSocket(String service_name) createSocket(String service_name, String host, int port) createSocket(String service_name, String host, int port, InetAddress localAddr, int localPort) createSocket(String service_name, InetAddress address, int port) createSocket(String service_name, InetAddress address, int port, InetAddress localAddr, int localPort) Returns all open sockets.protected <T> voidremove(T sock)
-
Field Details
-
sockets
-
-
Constructor Details
-
DefaultSocketFactory
public DefaultSocketFactory()
-
-
Method Details
-
createSocket
- Specified by:
createSocketin interfaceSocketFactory- Throws:
IOException
-
createSocket
- Specified by:
createSocketin interfaceSocketFactory- Throws:
IOException
-
createSocket
- Specified by:
createSocketin interfaceSocketFactory- Throws:
IOException
-
createSocket
public Socket createSocket(String service_name, String host, int port, InetAddress localAddr, int localPort) throws IOException - Specified by:
createSocketin interfaceSocketFactory- Throws:
IOException
-
createSocket
public Socket createSocket(String service_name, InetAddress address, int port, InetAddress localAddr, int localPort) throws IOException - Specified by:
createSocketin interfaceSocketFactory- Throws:
IOException
-
createServerSocket
- Specified by:
createServerSocketin interfaceSocketFactory- Throws:
IOException
-
createServerSocket
- Specified by:
createServerSocketin interfaceSocketFactory- Throws:
IOException
-
createServerSocket
public ServerSocket createServerSocket(String service_name, int port, int backlog) throws IOException - Specified by:
createServerSocketin interfaceSocketFactory- Throws:
IOException
-
createServerSocket
public ServerSocket createServerSocket(String service_name, int port, int backlog, InetAddress bindAddr) throws IOException - Specified by:
createServerSocketin interfaceSocketFactory- Throws:
IOException
-
createDatagramSocket
- Specified by:
createDatagramSocketin interfaceSocketFactory- Throws:
SocketException
-
createDatagramSocket
public DatagramSocket createDatagramSocket(String service_name, SocketAddress bindaddr) throws SocketException - Specified by:
createDatagramSocketin interfaceSocketFactory- Throws:
SocketException
-
createDatagramSocket
- Specified by:
createDatagramSocketin interfaceSocketFactory- Throws:
SocketException
-
createDatagramSocket
public DatagramSocket createDatagramSocket(String service_name, int port, InetAddress laddr) throws SocketException - Specified by:
createDatagramSocketin interfaceSocketFactory- Throws:
SocketException
-
createMulticastSocket
- Specified by:
createMulticastSocketin interfaceSocketFactory- Throws:
IOException
-
createMulticastSocket
- Specified by:
createMulticastSocketin interfaceSocketFactory- Throws:
IOException
-
createMulticastSocket
public MulticastSocket createMulticastSocket(String service_name, SocketAddress bindaddr) throws IOException - Specified by:
createMulticastSocketin interfaceSocketFactory- Throws:
IOException
-
close
- Specified by:
closein interfaceSocketFactory- Throws:
IOException
-
close
- Specified by:
closein interfaceSocketFactory- Throws:
IOException
-
close
- Specified by:
closein interfaceSocketFactory
-
getSockets
Description copied from interface:SocketFactoryReturns all open sockets. This method can be used to list or close all open sockets.- Specified by:
getSocketsin interfaceSocketFactory- Returns:
- A map of open sockets; keys are Sockets, ServerSockets, DatagramSockets or MulticastSockets, values are the service names.
-
add
-
remove
protected <T> void remove(T sock)
-