Package net.messagevortex.transport
Class ListeningSocketChannel
java.lang.Object
net.messagevortex.transport.ListeningSocketChannel
- Direct Known Subclasses:
ImapServer
-
Constructor Summary
ConstructorsConstructorDescriptionListeningSocketChannel(InetSocketAddress address, SocketListener listener) Creates a listening socket channel. -
Method Summary
Modifier and TypeMethodDescriptiongetName()intgetPort()Gets the currently used local port.Gets the security context of the channel.booleanvoidsetProtocol(String protocol) Set the protocol identifier of the channel.setSecurityContext(SecurityContext context) Sets the security context of the socket channel.setSocketListener(SocketListener listener) voidshutdown()Shutdown the socket channel.
-
Constructor Details
-
ListeningSocketChannel
public ListeningSocketChannel(InetSocketAddress address, SocketListener listener) throws IOException Creates a listening socket channel.
- Parameters:
address- the socket to be boundlistener- the listener to be used for incomming connections- Throws:
IOException- if the address cannot be bound
-
-
Method Details
-
setSocketListener
-
setName
-
getName
-
getSocketListener
-
setProtocol
Set the protocol identifier of the channel.
- Parameters:
protocol- the identifier string to be set- Returns:
- the previously set identifier
-
setSecurityContext
Sets the security context of the socket channel.
- Parameters:
context- the context to be set- Returns:
- the previously set context
-
getSecurityContext
Gets the security context of the channel.
- Returns:
- the currently set security context
-
getPort
public int getPort()Gets the currently used local port.
- Returns:
- the local port number
-
getProtocol
-
shutdown
public void shutdown()Shutdown the socket channel.
-
isShutdown
public boolean isShutdown()
-