Changes between Version 247 and Version 248 of WikiStart


Ignore:
Timestamp:
08/05/2014 01:46:36 PM (4 years ago)
Author:
Glyph
Comment:

Add endpoints to echo example. They've been here since Twisted 10.1, it's time to make them more discoverable.

Legend:

Unmodified
Added
Removed
Modified
  • WikiStart

    v247 v248  
    120120{{{
    121121#!python
    122 from twisted.internet import protocol, reactor
     122from twisted.internet import protocol, reactor, endpoints
    123123
    124124class Echo(protocol.Protocol):
     
    130130        return Echo()
    131131
    132 reactor.listenTCP(1234, EchoFactory())
     132endpoints.serverFromString(reactor, "tcp:1234", EchoFactory())
    133133reactor.run()
    134134}}}