Home | Trees | Index | Help |
---|
Package beepy :: Package core :: Module channel :: Class Channel |
|
Method Summary | |
---|---|
| |
Similar to allocateMsgno(), allocates a local ansno for a given msgno. | |
Identical to allocateRemoteSeqno() only used for the local side of a Channel connection. | |
allocateMsgno() allocates a unique msgno for a message by checking a list of allocated msgnos and picking the lowest number not already allocated. | |
Allocate the next sequence number for the remote side of a channel connection. | |
close() attempts to close the Channel. | |
deallocateMsgno() deallocates a previously allocated msgno. | |
isMessageOutstanding() checks to see if a particular message that was previously sent has been acknowledged. | |
Called by a Session when it receives a frame on this Channel to process the frame. | |
Used to send a frame over this channel. | |
sendAnswer() is used for sending a frame of type ANS | |
sendError() is used for sending a frame of type ERR | |
sendGreetingReply() is used to send the initial greeting message when a peer connects. | |
sendMessage() is used for sending a Message of type MSG | |
sendNul() is used for sending a frame of type NUL | |
sendReply() is used for sending a frame of type RPY | |
Set the priority level of this channel to priority. | |
Performs sanity checking on an inbound Frame before it is passed to a profile for processing. |
Class Variable Summary | |
---|---|
int |
channelnum = -1 |
long |
localSeqno = -1L
|
NoneType |
profile = None |
long |
remoteSeqno = -1L
|
Method Details |
---|
__init__(self,
channelnum,
profile,
session)
|
allocateLocalAnsno(self, msgno)Similar to allocateMsgno(), allocates a local ansno for a given msgno. Wraps to MIN_ANSNO at MAX_ANSNO.
|
allocateLocalSeqno(self, msgsize)Identical to allocateRemoteSeqno() only used for the local side of a Channel connection. Wraps to zero at MAX_SEQNO.
|
allocateMsgno(self)allocateMsgno() allocates a unique msgno for a message by checking a list of allocated msgnos and picking the lowest number not already allocated. Allocated msgnos should be removed from the list when the complete reply to the message is received. See deallocateMsgno().
|
allocateRemoteSeqno(self, msgsize)Allocate the next sequence number for the remote side of a channel connection. Wraps to zero at MAX_SEQNO.
|
close(self)close() attempts to close the Channel. A Channel is not supposed to close unless all messages sent on the channel have been acknowledged and any messages inbound have been completely received.
|
deallocateMsgno(self, msgno)deallocateMsgno() deallocates a previously allocated msgno. This should be called when a complete reply to a message is received and processed. This is most likely to be used from within a profile to signify that the message has been completely dealt with.
|
isMessageOutstanding(self, msgno=None)isMessageOutstanding() checks to see if a particular message that was previously sent has been acknowledged. If no msgno is supplies, checks to see if there are any outstanding messages on this channel.
|
processFrame(self, theframe)Called by a Session when it receives a frame on this Channel to process the frame.
|
send(self, msg)Used to send a frame over this channel. Predominantly used by the Profile bound to this channel to send messages. send() passes the Message to the Session and its associated transport layer. If messages are sent asynchronously (such as with fragmentation) then you should use the callback as a way to signify that the call finished.
|
sendAnswer(self, msgno, data)sendAnswer() is used for sending a frame of type ANS
|
sendError(self, msgno, data)sendError() is used for sending a frame of type ERR
|
sendGreetingReply(self, data)sendGreetingReply() is used to send the initial greeting message when a peer connects. It is identical to sendReply except that it doesn't check for a received Msgno as there isn't one. The msgno for this message is set to 0 as this must be the first frame sent.
|
sendMessage(self, data, cb=None, errback=None)sendMessage() is used for sending a Message of type MSG
|
sendNul(self, msgno)sendNul() is used for sending a frame of type NUL NUL frames are used to finish a series of ANS frames in response to a MSG. The msgno here is the msgno of the message to which the previous ANS frames were an answer to.
|
sendReply(self, msgno, data, cb=None, errback=None, *args)sendReply() is used for sending a frame of type RPY The msgno here is the msgno of the message to which this is a reply.
|
setPriority(self, priority)Set the priority level of this channel to priority. priority must be between -10 and 10. |
validateFrame(self, theframe)Performs sanity checking on an inbound Frame before it is passed to a profile for processing.
|
Class Variable Details |
---|
channelnum
|
localSeqno
|
profile
|
remoteSeqno
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.0 on Thu Sep 30 14:39:26 2004 | http://epydoc.sf.net |