Home | Trees | Index | Help |
---|
Package twisted :: Package protocols :: Module msn :: Class MSNSwitchboardClient |
|
BaseProtocol
--+ |Protocol
--+ |LineReceiver
--+ |MSNEventBase
--+ | MSNSwitchboardClient
this class provides support for clients connecting to a switchboard server.
Switchboard servers are used for conversations with other people on the MSN network. This means that the number of conversations at any given time will be directly proportional to the number of connections to varioius switchboard servers. MSN makes no distinction between single and group conversations, so any number of users may be invited to join a specific conversation taking place on a switchboard server.Method Summary | |
---|---|
__init__(self)
| |
hook for detecting any notification type messages (e.g. | |
Clear buffered data. (inherited from LineReceiver )
| |
(Deprecated) (inherited from Protocol )
| |
Called when the connection is shut down. | |
Called when a connection is made. | |
Protocol.dataReceived. (inherited from LineReceiver )
| |
used to reply to a file transfer invitation. | |
called when a handler notifies me that this line is broken (inherited from MSNEventBase )
| |
called after connecting to an existing chat session. | |
called when the server sends an error which is not in response to a sent command (ie. (inherited from MSNEventBase )
| |
called when we receive a message. | |
called when a contact is trying to send us a file. | |
handle_ACK(self,
params)
| |
handle_ANS(self,
params)
| |
handle_BYE(self,
params)
| |
handle_CAL(self,
params)
| |
handle_IRO(self,
params)
| |
handle_JOI(self,
params)
| |
handle_MSG(self,
params)
(inherited from MSNEventBase )
| |
handle_NAK(self,
params)
| |
implement me in subclasses if you want to handle unknown events (inherited from MSNEventBase )
| |
handle_USR(self,
params)
| |
used to invite a user to the current switchboard server. | |
Called when the maximum line length has been reached. (inherited from LineReceiver )
| |
Override this for when each line is received. (inherited from MSNEventBase )
| |
called when all login details have been negotiated. | |
Make a connection to a transport and a server. (inherited from BaseProtocol )
| |
Override this for when raw data is received. (inherited from MSNEventBase )
| |
send an notification that we want to send a file. | |
Sends a line to the other end of the connection. (inherited from LineReceiver )
| |
used to send a message. | |
send information relating to a file transfer session. | |
used to send a typing notification. | |
Sets the line-mode of this receiver. (inherited from LineReceiver )
| |
Sets the raw mode of this receiver. (inherited from LineReceiver )
| |
called when a user has joined the conversation. | |
called when a user has left the conversation. | |
called when we receive the special type of message notifying us that a user is typing a message. | |
helper method for checkMessage | |
helper method for checkMessage | |
helper method for checkMessage | |
helper method for checkMessage | |
return a unique transaction ID that is mapped internally to a deferred .. (inherited from MSNEventBase )
| |
Fire the callback for the given id if one exists and return 1, else return false (inherited from MSNEventBase )
| |
_newInvitationCookie(self)
| |
return a usable transaction ID (inherited from MSNEventBase )
| |
send initial data based on whether we are replying to an invitation or starting one. |
Instance Variable Summary | |
---|---|
key
- authorization key, obtained when receiving invitation / requesting
switchboard server. | |
reply
- set this to 1 in connectionMade or before to signifiy that you are
replying to a switchboard invitation. | |
sessionID
- unique session ID, used if you are replying to a switchboard
invitation | |
userHandle
- your user handle (passport) |
Class Variable Summary | |
---|---|
int |
key
|
int |
reply
|
str |
sessionID
|
str |
userHandle
|
int |
_iCookie
|
Method Details |
---|
checkMessage(self, message)hook for detecting any notification type messages (e.g. file transfer) |
connectionLost(self, reason)Called when the connection is shut down. Clear any circular references here, and any external references to this Protocol. The connection has been closed.
|
connectionMade(self)Called when a connection is made. This may be considered the initializer of the protocol, because it is called when the connection is completed. For clients, this is called once the connection to the server has been established; for servers, this is called after an accept() call stops blocking and a socket has been received. If you need to send any greeting or initial message, do it here.
|
fileInvitationReply(self, iCookie, accept=1)used to reply to a file transfer invitation.
|
gotChattingUsers(self, users)called after connecting to an existing chat session.
|
gotMessage(self, message)called when we receive a message.
|
gotSendRequest(self, fileName, fileSize, iCookie, message)called when a contact is trying to send us a file. To accept or reject this transfer see the fileInvitationReply method.
|
inviteUser(self, userHandle)used to invite a user to the current switchboard server.
|
loggedIn(self)called when all login details have been negotiated. Messages can now be sent, or new users invited. |
sendFileInvitation(self, fileName, fileSize)send an notification that we want to send a file.
|
sendMessage(self, message)used to send a message.
|
sendTransferInfo(self, accept, iCookie, authCookie, ip, port)send information relating to a file transfer session.
|
sendTypingNotification(self)used to send a typing notification. Upon receiving this message the official client will display a 'user is typing' message to all other users in the chat session for 10 seconds. The official client sends one of these every 5 seconds (I think) as long as you continue to type. |
userJoined(self, userHandle, screenName)called when a user has joined the conversation.
|
userLeft(self, userHandle)called when a user has left the conversation.
|
userTyping(self, message)called when we receive the special type of message notifying us that a user is typing a message.
|
_checkFileInfo(self, message, info)helper method for checkMessage |
_checkFileInvitation(self, message, info)helper method for checkMessage |
_checkFileResponse(self, message, info)helper method for checkMessage |
_checkTyping(self, message, cTypes)helper method for checkMessage |
_sendInit(self)send initial data based on whether we are replying to an invitation or starting one. |
Instance Variable Details |
---|
keyauthorization key, obtained when receiving invitation / requesting switchboard server. |
replyset this to 1 in connectionMade or before to signifiy that you are replying to a switchboard invitation. |
sessionIDunique session ID, used if you are replying to a switchboard invitation |
userHandleyour user handle (passport) |
Class Variable Details |
---|
key
|
reply
|
sessionID
|
userHandle
|
_iCookie
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 1.1 on Fri Jun 27 03:48:34 2003 | http://epydoc.sf.net |