简体   繁体   English

Python非阻塞套接字和可靠的UDP

[英]Python nonblocking sockets and reliable UDP

For a graduate-level project, I'm being asked to create a reliable UDP implementation in Python. 对于一个研究生项目,有人要求我在Python中创建可靠的UDP实现。 I have experience with socket programming in Python, but mostly TCP or "fire and forget"-type UDP stuff. 我有使用Python进行套接字编程的经验,但是主要使用TCP或“即发即弃”类型的UDP。 I essentially have to create UDP with TCP congestion control. 我基本上必须使用TCP拥塞控制来创建UDP。 My main question is this: 我的主要问题是:

How can I send packets and receive acknowledgments at the same time? 如何同时发送数据包和接收确认? I think the problem is the blocking socket.recv() call. 我认为问题是阻塞了socket.recv()调用。 How is this typically handled? 通常如何处理?

Any help with this or general advice on implementing reliable UDP would be very helpful! 任何有关实现可靠UDP的建议或常规建议都将非常有帮助!

http://twistedmatrix.com/trac/ is a perfect match for your needs, its not very easy for newcomers though. http://twistedmatrix.com/trac/完全可以满足您的需求,但是对于新手来说并不容易。

This blog is a great resource to start from: http://krondo.com/?page_id=1327 该博客是一个很好的资源,可以从以下网址开始: http : //krondo.com/?page_id=1327

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM