|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.activeio.net.SocketStreamChannelServer
A StreamChannelServer that creates
org.activeio.net.TcpStreamChannel
objects from accepted
tcp socket connections.
Field Summary |
Fields inherited from interface org.activeio.StreamChannelServer |
NO_WAIT_TIMEOUT, WAIT_FOREVER_TIMEOUT |
Constructor Summary | |
SocketStreamChannelServer(ServerSocket serverSocket,
URI bindURI,
URI connectURI)
|
Method Summary | |
Channel |
accept(long timeout)
|
protected Channel |
createChannel(Socket socket)
|
void |
dispose()
This method should not throw any exceptions. |
URI |
getBindURI()
The URI that was used when the channel was bound. |
URI |
getConnectURI()
Once bound, the channel may be able to construct a URI that is more sutible for when a client needs to connect to the server. |
Object |
narrow(Class target)
Since a Channel may be composed from a chain of other Channel obejcts, this method allows you to query the chain for the specified interface. |
void |
start()
Starts the channel. |
void |
stop(long timeout)
Stops the channel. |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SocketStreamChannelServer(ServerSocket serverSocket, URI bindURI, URI connectURI)
serverSocket
- bindURI
- connectURI
- Method Detail |
public Channel accept(long timeout) throws IOException
accept
in interface StreamChannelServer
IOException
protected Channel createChannel(Socket socket) throws IOException
IOException
public void dispose()
Disposable
dispose
in interface Disposable
Disposable.dispose()
public URI getBindURI()
ChannelServer
getBindURI
in interface ChannelServer
public URI getConnectURI()
ChannelServer
getConnectURI
in interface ChannelServer
public void start() throws IOException
Service
start
in interface Service
IOException
public void stop(long timeout) throws IOException
Service
stop
in interface Service
timeout
- The amount of time the channel is allowed to take to gracefully stop. If the timeout
is exceeded, the channel should do a forcefull stop.
IOException
public Object narrow(Class target)
Channel
narrow
in interface Channel
public String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |