Given below is the code for a server:
from twisted.internet import protocol
from twisted.internet import reactor
class Echo(protocol.Protocol):
def dataRecvd(self, data):
self.transport.write(data)
class EchoFactory(protocol.Factory):
def buildProtocol(self, addr):
return Echo()
reactor.listenTCP(8000,EchoFactory())
reactor.run()
I get the following error:
listenTCP()- Undefined variable from import
run- Undefined variable from import
I am using pydev with eclipse on windows 7. Where am I going wrong?