简体   繁体   English

如何制作简单的 python UDP 套接字服务器?

[英]How to make simple python UDP socket server?

I am trying to make a python socket server based on UDP.我正在尝试基于 UDP 制作 python 套接字服务器。

The point is that we need to receive data from the Java client socket server and the python UDP protocol socket server must throw JSON data to React in the front. The point is that we need to receive data from the Java client socket server and the python UDP protocol socket server must throw JSON data to React in the front.

I have the level of knowledge to make a simple UDP chat server, so I'm worried a lot now.我有做一个简单的UDP聊天服务器的知识水平,所以我现在很担心。 I am currently reading the django channels official documentation.我目前正在阅读 django 频道官方文档。 Does django-channeles provide easy configuration to use UDP protocol as well? django-channeles 是否也提供简单的配置以使用 UDP 协议?

There is a specification for raw UDP in the docs .文档中有原始 UDP 的规范。 UDP is not reliable as some of the data may be lost, so it is not widely used. UDP 不可靠,因为有些数据可能会丢失,所以没有广泛使用。 If you must use it, you have to implement a UDP consumer based on the specification using the websocket consumers as a template如果必须使用它,则必须使用 websocket 消费者作为模板,根据规范实现 UDP 消费者

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

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