简体   繁体   English

如何在 Django 中使用 UDP 向客户端发送数据?

[英]How to use UDP to send data to client in Django?

I have read that Django uses HTTP request response architecture to process user requests.我读过 Django 使用 HTTP 请求响应架构来处理用户请求。 And we all know HTTP is an application layer protocol designed within the framework of the Internet protocol suite.并且我们都知道HTTP是在Internet协议套件的框架内设计的应用层协议。 Its definition presumes an underlying and reliable transport layer protocol, and Transmission Control Protocol (TCP).它的定义假定了一个底层和可靠的传输层协议,以及传输控制协议 (TCP)。 So my question is if django uses tcp to establish connection and suppose I want to serve videos or some other file using UDP.所以我的问题是 django 是否使用 tcp 建立连接并假设我想使用 UDP 提供视频或其他一些文件。 How can I achieve this?我怎样才能做到这一点?

You Can Use Django Channels with WebRTC ( RFC Here ) And Provide Real Time Communications Over TCP via Channels Package there are many useful sources to achieve.您可以将 Django Channels 与 WebRTC(此处RFC )一起使用,并通过 Channels Package 通过 TCP 提供实时通信,有许多有用的来源可以实现。 and also you can implement a microservice architecture to serve videos or some other file using UDP Like Node.js Server or etc.并且您还可以实现微服务架构以使用 UDP 像 Node.js 服务器等来提供视频或其他文件。

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

相关问题 服务器如何在Qt中通过udp将数据发送到nat后面的客户端? - how could a server send data to a client behind nat by udp in qt? 如何通过 UDP 从远程机器(客户端)向本地机器(服务器)发送 Python 的数据? - How to send data with Python over UDP from remote machine (client) to local machine (server)? 如何将数据从 python 客户端发送到 Django web 服务器? - How to send data from python client to Django web server? 如何向客户端发送数据? - How to send data to a client? 如何在 udp 服务器(在 c 中)和 udp 客户端(python)之间发送和接收 c 结构? - how to send and recv c struct between udp server(in c) and udp client(python)? 如何以智能方式将UDP客户端消息发送到UDP服务器解析消息 - How to send UDP client message in smart way to the UDP server parse the message 龙卷风如何使用管道异步发送数据到客户端? - How can tornado use pipe to async send data to client? 使用 Python 的简单“聊天”UDP 客户端和服务器,不能使用 `str` 作为 `send()` 有效负载 - Simple 'chat' UDP client and server using Python, can't use `str` as `send()` payload 如何同时发送和接收数据 Python UDP socket - How to send and receive data the same time Python UDP socket 如何在 MatLab 中从 Python UDP 客户端接收 UDP 数据。 - How can receive UDP data from Python UDP client in MatLab.
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM