|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.cindy.session.AbstractSession
net.sf.cindy.session.nio.AbstractChannelSession
net.sf.cindy.session.nio.ServerSocketChannelSession
public class ServerSocketChannelSession
Server socket channel session. Application can override buildSession method to build custom session.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.sf.cindy.session.nio.AbstractChannelSession |
---|
AbstractChannelSession.ChannelReactorHandler |
Constructor Summary | |
---|---|
ServerSocketChannelSession()
|
Method Summary | |
---|---|
protected void |
buildSession(java.nio.channels.SocketChannel sc)
Build accepted session. |
protected void |
doClose()
|
protected void |
doStart()
|
java.nio.channels.ServerSocketChannel |
getChannel()
Get the server socket channel associted with the session. |
java.net.SocketAddress |
getLocalAddress()
Get the local address which the session bind with. |
protected ReactorHandler |
getReactorHandler()
Get reactor handler. |
java.net.SocketAddress |
getRemoteAddress()
Get the remote address which the session connmected to. |
SessionType |
getSessionType()
Get session type. |
java.net.ServerSocket |
getSocket()
Get the server socket associted with the session. |
Future |
send(Packet packet,
int priority)
|
void |
setChannel(java.nio.channels.ServerSocketChannel ssc)
Set the server socket channel which the session will used. |
void |
setLocalPort(int port)
Set the port the server socket session listen to. |
Methods inherited from class net.sf.cindy.session.nio.AbstractChannelSession |
---|
close, getReactor, isStarted, send, start |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServerSocketChannelSession()
Method Detail |
---|
public SessionType getSessionType()
Session
public java.net.SocketAddress getRemoteAddress()
Session
getRemoteAddress
in interface Session
getRemoteAddress
in class AbstractSession
public java.net.SocketAddress getLocalAddress()
Session
getLocalAddress
in interface Session
getLocalAddress
in class AbstractSession
public void setLocalPort(int port)
port
- listen port
java.lang.IllegalStateException
public void setChannel(java.nio.channels.ServerSocketChannel ssc)
ssc
- server socket channel
java.lang.IllegalStateException
public java.nio.channels.ServerSocketChannel getChannel()
public java.net.ServerSocket getSocket()
public Future send(Packet packet, int priority)
protected ReactorHandler getReactorHandler()
AbstractChannelSession
getReactorHandler
in class AbstractChannelSession
protected void buildSession(java.nio.channels.SocketChannel sc)
sc
- the socket channel that server socket session acceptedprotected void doStart() throws java.io.IOException
doStart
in class AbstractChannelSession
java.io.IOException
protected void doClose()
doClose
in class AbstractChannelSession
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |