def connectableEndpoint(debug=False):
 reactor = MemoryReactorClock()
 clientEndpoint = TCP4ClientEndpoint(reactor, '0.0.0.0', 4321)
 serverEndpoint = TCP4ServerEndpoint(reactor, 4321)
 serverEndpoint.listen(Factory.forProtocol(Protocol))
 return (clientEndpoint, ConnectionCompleter(reactor))

def connectableEndpoint ( debug = False ) : reactor = MemoryReactorClock ( ) clientEndpoint = TCP4ClientEndpoint ( reactor , '0.0.0.0' , 4321 ) serverEndpoint = TCP4ServerEndpoint ( reactor , 4321 ) serverEndpoint . listen ( Factory . forProtocol ( Protocol ) ) return ( clientEndpoint , ConnectionCompleter ( reactor ) )
create an endpoint that can be fired on demand .