|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.beepcore.beep.core.Session | +--org.beepcore.beep.transport.tcp.TCPSession
Provides the TCP transport mapping for BEEP according to RFC 3081.
Field Summary |
Fields inherited from class 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 |
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.). |
protected boolean |
updateMyReceiveBufferSize(Channel channel,
long previouslySeq,
long currentSeq,
int previouslyUsed,
int currentlyUsed,
int bufferSize)
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, toString, wait, wait, wait |
Method Detail |
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
Session
Session
gracefully. The profiles for
the open channels on the session may veto the close request.
close
in class Session
BEEPException
public java.net.Socket getSocket()
public void terminate(java.lang.String reason)
Session
terminate
in class Session
reason
- protected void disableIO()
Session
disableIO
in class Session
protected void enableIO()
Session
enableIO
in class Session
protected int getMaxFrameSize()
Session
getMaxFrameSize
in class Session
protected void sendFrame(Frame f) throws BEEPException
sendFrame
in class Session
f
- the Frame to send.
BEEPException
protected Session reset(SessionCredential localCred, SessionCredential peerCred, SessionTuningProperties tuning, ProfileRegistry reg, java.lang.Object argument) throws BEEPException
Session
reset
in class Session
Session
with the tuning complete.
BEEPException
protected boolean updateMyReceiveBufferSize(Channel channel, long previouslySeq, long currentSeq, int previouslyUsed, int currentlyUsed, int bufferSize) throws BEEPException
updateMyReceiveBufferSize
in class Session
channel
- previouslySeq
- currentSeq
- previouslyUsed
- currentlyUsed
- bufferSize
-
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 |