[Twisted-Python] Twisted lineReceived (sender)

Lee Connell lee.a.connell at gmail.com
Sat Jan 13 14:04:23 EST 2007


Thanks,

getPeer() works for ip and port, however it wouldn't work in my case,
because I want to determine one client from another, if multiple clients
were coming from the same address this would fail.

Loop through the factory.clients first and...

I just compared "if client != self:" send the message

I just looked through the API to get more info on these, API seems a bit
scarce, is this something that will be complete soon?

-----Original Message-----
From: twisted-python-bounces at twistedmatrix.com
[mailto:twisted-python-bounces at twistedmatrix.com] On Behalf Of Eric Mangold
Sent: Saturday, January 13, 2007 12:31 AM
To: Twisted general discussion
Subject: Re: [Twisted-Python] Twisted lineReceived (sender)

On Fri, 12 Jan 2007 22:24:41 -0600, Lee Connell <lee.a.connell at gmail.com>  
wrote:

> I just started with twisted and want to write a simple chat server.  This
> code here works fine, however I want to know who the data is coming from  
> in the callbacks or events.

Inside a Protocol method self.transport.getPeer() should give you what you  
want.

-- 
Eric Mangold
Twisted/Win32 Co-Maintainer

_______________________________________________
Twisted-Python mailing list
Twisted-Python at twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.10/624 - Release Date: 1/12/2007
2:04 PM
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.10/624 - Release Date: 1/12/2007
2:04 PM
 





More information about the Twisted-Python mailing list