org.avineas.io.tcp
public class ServerSocketChannelProvider extends java.lang.Object
Constructor and Description |
---|
ServerSocketChannelProvider(int port)
Listen to connections on a specific TCP port with a default backlog.
|
ServerSocketChannelProvider(int port,
int backlog)
Listen to connections on a specific TCP port with a specified backlog
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
Channel |
getChannel(long timeout)
Get a channel from this provider, waiting for some time if needed.
|
java.lang.String |
toString() |
public ServerSocketChannelProvider(int port) throws java.io.IOException
port
- The port to listen onjava.io.IOException
- In case of errorspublic ServerSocketChannelProvider(int port, int backlog) throws java.io.IOException
port
- The port to listen onbacklog
- The number of pending connections that are allowedjava.io.IOException
- In case of errorspublic void close()
public java.lang.String toString()
toString
in class java.lang.Object
public Channel getChannel(long timeout)
ChannelProvider
getChannel
in interface ChannelProvider
timeout
- The timeout in ms for the channel to become available