|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.beepcore.beep.core.SessionImpl
org.beepcore.beep.transport.tcp.TCPSession
Provides the TCP transport mapping for BEEP according to RFC 3081.
Field Summary |
Fields inherited from interface org.beepcore.beep.core.Session |
SESSION_STATE_ABORTED, SESSION_STATE_ACTIVE, SESSION_STATE_CLOSE_PENDING, SESSION_STATE_CLOSED, SESSION_STATE_CLOSING, SESSION_STATE_GREETING_SENT, SESSION_STATE_INITIALIZED, SESSION_STATE_TUNING, SESSION_STATE_TUNING_PENDING |
Method Summary | |
void |
close()
Closes the Session gracefully. |
static TCPSession |
createInitiator(java.net.Socket sock,
ProfileRegistry registry)
Creates a TCPSession for a Socket that was created by initiating a connection. |
static TCPSession |
createInitiator(java.net.Socket sock,
ProfileRegistry registry,
java.lang.String servername)
Creates a TCPSession for a Socket that was created by initiating a connection. |
static TCPSession |
createListener(java.net.Socket sock,
ProfileRegistry registry)
Creates a TCPSession for a Socket that was created by listening and accepting a connection. |
protected void |
disableIO()
Method disableIO |
protected void |
enableIO()
Method enableIO |
protected int |
getMaxFrameSize()
Returns the maximum frame size that a channel should send for this session. |
java.net.Socket |
getSocket()
|
protected Session |
reset(SessionCredential localCred,
SessionCredential peerCred,
SessionTuningProperties tuning,
ProfileRegistry reg,
java.lang.Object argument)
This method is used by a tuning profile to reset the session after the tuning is complete. |
protected void |
sendFrame(Frame f)
Generates a header, then writes the header, payload, and trailer to the wire. |
void |
terminate(java.lang.String reason)
This method is used to terminate the session when there is an non-recoverable error in the BEEP protocol (framing error, etc.). |
java.lang.String |
toString()
|
protected boolean |
updateMyReceiveBufferSize(Channel channel,
long currentSeq,
int currentAvail)
Update the channel window size with the remote peer by sending SEQ frames as per RFC 3081. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
public static TCPSession createInitiator(java.net.Socket sock, ProfileRegistry registry, java.lang.String servername) throws BEEPException
sock
- registry
- servername
-
BEEPException
public static TCPSession createInitiator(java.net.Socket sock, ProfileRegistry registry) throws BEEPException
sock
- registry
-
BEEPException
public static TCPSession createListener(java.net.Socket sock, ProfileRegistry registry) throws BEEPException
sock
- registry
-
BEEPException
public void close() throws BEEPException
SessionImpl
Session
gracefully. The profiles for
the open channels on the session may veto the close request.
close
in interface Session
close
in class SessionImpl
BEEPException
public java.net.Socket getSocket()
public void terminate(java.lang.String reason)
SessionImpl
terminate
in interface Session
terminate
in class SessionImpl
reason
- public java.lang.String toString()
toString
in class SessionImpl
protected void disableIO()
SessionImpl
disableIO
in class SessionImpl
protected void enableIO()
SessionImpl
enableIO
in class SessionImpl
protected int getMaxFrameSize()
SessionImpl
getMaxFrameSize
in class SessionImpl
protected void sendFrame(Frame f) throws BEEPException
sendFrame
in class SessionImpl
f
- the Frame to send.
BEEPException
protected Session reset(SessionCredential localCred, SessionCredential peerCred, SessionTuningProperties tuning, ProfileRegistry reg, java.lang.Object argument) throws BEEPException
SessionImpl
reset
in class SessionImpl
Session
with the tuning complete.
BEEPException
protected boolean updateMyReceiveBufferSize(Channel channel, long currentSeq, int currentAvail) throws BEEPException
updateMyReceiveBufferSize
in class SessionImpl
channel
- currentSeq
- currentAvail
-
BEEPException
- if a specified buffer size is larger
than what's available on the Socket.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |