[Twisted-Python] “Unhandled Error” comes when TCP server tries to accept connections from client in twisted

jaspreet singh Kalsi jaspreetsingh4575 at gmail.com
Fri Jun 28 14:03:23 MDT 2013

from twisted.internet.protocol import Factory,Protocolfrom
twisted.internet import reactor
class ChatServer(Protocol):
    def connectionMade(self):
    print "A Client Has Connected"

factory = Factory()
reactor.listenTCP(80,factory)print "Chat Server Started"


the above code is running succesfully.but when I try to open
TCP(telnet localhost 80).

Errors occurs :

Unhandled ErrorTraceback (most recent call last):
  File "C:\Python27\lib\site-packages\twisted\python\log.py", line 69,
in callWithContext
    return context.call({ILogContext: newCtx}, func, *args, **kw)
  File "C:\Python27\lib\site-packages\twisted\python\context.py", line
118, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "C:\Python27\lib\site-packages\twisted\python\context.py", line
81, in callWithContext
    return func(*args,**kw)
  File "C:\Python27\lib\site-packages\twisted\internet\selectreactor.py",
line 150, in _doReadOrWrite
    why = getattr(selectable, method)()--- <exception caught here> ---
  File "C:\Python27\lib\site-packages\twisted\internet\tcp.py", line
718, in doRead
    protocol = self.factory.buildProtocol(self._buildAddr(addr))
  File "C:\Python27\lib\site-packages\twisted\internet\protocol.py",
line 104, in buildProtocol
    p = self.protocol()
exceptions.TypeError: 'NoneType' object is not callable

I m using windows 8,python 2.7 and Twisted 12.0

sir/mam i have also discuss this question on stackoverflow ...but i
did'nt get any appropriate answer.....

please help me .
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20130629/b578740e/attachment-0001.html>

More information about the Twisted-Python mailing list