[Twisted-Python] Weird thread count

soso duke99 at email.ro
Wed Oct 22 14:28:31 MDT 2003


Hello all, 

The following client code creates 3 threads on startup, even if there is no
server to connect to. And I have no clue why. I'm running on Win2k and that's
what taskmanager says. Any ideas?

<<<<<<<<<<<<<<<<<<<<<<
from twisted.internet.protocol import Protocol, ClientFactory
from twisted.internet import reactor

class CommProtocol(Protocol):
    
    def connectionMade(self):
        print 'Connected'
        self.transport.write("Hello there...")
        
    def connectionLost(self, reason):
        print 'Connection lost: ', reason
        
    def dataReceived(self, data):
        print 'Data received: ', str(data)
        
class CommFactory(ClientFactory):
    
    protocol = CommProtocol
    
    def clientConnectionFailed(self, connector, reason):
        print "Failed to connect: ", reason
        
host = 'localhost'
port = 8000

reactor.connectTCP(host, port, CommFactory())
reactor.run()
>>>>>>>>>>>>>>>>>>>>>>>>>


Thanks,
soso

______________________________________________________________________
Do you want a free e-mail for life ? Get it at http://www.email.ro/





More information about the Twisted-Python mailing list