UDP client and server with Twisted Python

前端 未结 2 486
北海茫月
北海茫月 2021-02-01 10:53

I want to create a server and client that sends and receives UDP packets from the network using Twisted. I\'ve already written this with sockets in Python, but want to take adva

2条回答
  •  迷失自我
    2021-02-01 11:52

    Check out the echoclient_udp.py example.

    Since UDP is pretty much symmetrical between client and server, you just want to run reactor.listenUDP there too, connect to the server (which really just sets the default destination for sent packets), then transport.write to send your packets.

提交回复
热议问题