[Twisted-Python] How to send data from another reactor instance

Werner Thie werner at thieprojects.ch
Fri Sep 12 18:21:53 MDT 2014


Hi

consider this for TCP, adapt to UDP

http://stackoverflow.com/questions/15640640/python-twisted-man-in-the-middle-implementation/15645169#15645169

Werner

On 9/12/14 11:26 AM, User User wrote:
> Hi,
> I have the codes below and I would like to know how is it possible to
> send out data which came to "a" instance from "b" i mean data to port
> 2000 go out from port "2001" !?

Is there anybody listening on port 2000?

>
> class fact(DatagramProtocol):
>      def datagramReceived(self, datagram, addr):
>          self.transport.write( datagram, some_where )
>
> a = reactor.listenUDP(2001, fact())
> b = reactor.listenUDP(2002, fact())
>
>
>
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>





More information about the Twisted-Python mailing list