use twisted example code
This commit is contained in:
parent
738595d77c
commit
d536d076b6
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
from twisted.internet import protocol, reactor, endpoints
|
||||
|
||||
class Echo(protocol.Protocol):
|
||||
def dataReceived(self, data):
|
||||
self.transport.write(data)
|
||||
|
||||
class EchoFactory(protocol.Factory):
|
||||
def buildProtocol(self, addr):
|
||||
return Echo()
|
||||
|
||||
endpoints.serverFromString(reactor, "tcp:13327").listen(EchoFactory())
|
||||
reactor.run()
|
||||
|
||||
|
Loading…
Reference in New Issue