Home | Trees | Index | Help |
|
---|
Package twisted :: Package protocols :: Module msn :: Class SwitchboardClient |
|
BaseProtocol
--+ |Protocol
--+ |LineReceiver
--+ |MSNEventBase
--+ | SwitchboardClient
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)
| |
helper method for checkMessage | |
helper method for checkMessage | |
helper method for checkMessage | |
helper method for checkMessage | |
_newInvitationCookie(self)
| |
send initial data based on whether we are replying to an invitation or starting one. | |
hook for detecting any notification type messages (e.g. | |
connectionLost(self,
reason)
| |
Called when a connection is made. | |
used to reply to a file transfer invitation. | |
called after connecting to an existing chat session. | |
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_NAK(self,
params)
| |
handle_USR(self,
params)
| |
used to invite a user to the current switchboard server. | |
called when all login details have been negotiated. | |
send an notification that we want to send a file. | |
used to send a message. | |
send information relating to a file transfer session. | |
used to send a typing notification. | |
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. | |
Inherited from MSNEventBase | |
return a unique transaction ID that is mapped internally to a deferred .. | |
Fire the callback for the given id if one exists and return 1, else return false | |
return a usable transaction ID | |
called when a handler notifies me that this line is broken | |
called when the server sends an error which is not in response to a sent command (ie. | |
| |
implement me in subclasses if you want to handle unknown events | |
Override this for when each line is received. | |
Override this for when raw data is received. | |
Inherited from LineReceiver | |
Clear buffered data. | |
Protocol.dataReceived. | |
Called when the maximum line length has been reached. | |
Sends a line to the other end of the connection. | |
Sets the line-mode of this receiver. | |
Sets the raw mode of this receiver. | |
Inherited from Protocol | |
(Deprecated) | |
Inherited from BaseProtocol | |
Make a connection to a transport and a server. |
Instance Variable Summary | |
---|---|
int |
key : authorization key, obtained when receiving invitation / requesting
switchboard server. |
int |
reply : set this to 1 in connectionMade or before to signifiy that you are
replying to a switchboard invitation. |
str |
sessionID : unique session ID, used if you are replying to a switchboard
invitation |
str |
userHandle : your user handle (passport) |
Class Variable Summary | |
---|---|
int |
_iCookie = 0 |
Inherited from LineReceiver | |
str |
_LineReceiver__buffer = ''
|
str |
delimiter : The line-ending delimiter to use. |
int |
line_mode = 1 |
int |
MAX_LENGTH : The maximum length of a line to allow (If a sent line is longer than
this, the connection is dropped). |
Inherited from Protocol | |
tuple |
__implements__ = (<class twisted.internet.interfaces.IPr...
|
Inherited from BaseProtocol | |
int |
connected = 0 |
NoneType |
transport = None |
Method Details |
---|
_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. |
checkMessage(self, message)hook for detecting any notification type messages (e.g. file transfer) |
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.
|
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 |
---|
_iCookie
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.0 on Sat May 15 20:08:04 2004 | http://epydoc.sf.net |