public class ListeningSocketChannel extends Object
Constructor and Description |
---|
ListeningSocketChannel(InetSocketAddress address,
SocketListener listener)
Creates a listening socket channel.
|
Modifier and Type | Method and Description |
---|---|
String |
getName() |
int |
getPort()
Gets the currently used local port.
|
String |
getProtocol() |
SecurityContext |
getSecurityContext()
Gets the security context of the channel.
|
SocketListener |
getSocketListener() |
boolean |
isShutdown() |
void |
setName(String name) |
String |
setProtocol(String protocol)
Set the protocol identifier of the channel.
|
SecurityContext |
setSecurityContext(SecurityContext context)
Sets the security context of the socket channel.
|
SocketListener |
setSocketListener(SocketListener listener) |
void |
shutdown()
Shutdown the socket channel.
|
public ListeningSocketChannel(InetSocketAddress address, SocketListener listener) throws IOException
Creates a listening socket channel.
address
- the socket to be boundlistener
- the listener to be used for incomming connectionsIOException
- if the address cannot be boundpublic SocketListener setSocketListener(SocketListener listener)
public void setName(String name)
public String getName()
public SocketListener getSocketListener()
public String setProtocol(String protocol)
Set the protocol identifier of the channel.
protocol
- the identifier string to be setpublic SecurityContext setSecurityContext(SecurityContext context)
Sets the security context of the socket channel.
context
- the context to be setpublic SecurityContext getSecurityContext()
Gets the security context of the channel.
public int getPort()
Gets the currently used local port.
public String getProtocol()
public void shutdown()
Shutdown the socket channel.
public boolean isShutdown()
Copyright © 2023. All rights reserved.