禁用回车符

发布于 2024-10-20 06:22:21 字数 88 浏览 2 评论 0原文

我正在使用简单的 UDP 连接。

我想知道默认情况下连接是否启用或禁用“回车”,以及如何设置该属性?

谢谢,

雷。

I am using simple UDP connection.

I would like to know if by default the connection has "Carriage return" enabled or disabled, and how could I set that property?

thanks,

ray.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

浮生未歇 2024-10-27 06:22:21

呃,这并不完全准确。 UDP 在发送文本和二进制方面没有区别。所有网络协议最终都以比特流(二进制)的形式发送数据。它的典型区别在于,与 TCP 不同,没有来回建立用于跟踪数据包的序列号,也没有 ACK 标志来表示已收到数据包。 UDP 会发送数据包,不管它们是否到达目的地。

编辑:雷也许你应该提供更多关于你想要做什么的细节。回车符与其他字符一样都是 ascii 字符。它具有数字表示形式,并像其他 ASCII 字符一样占用一个字节的空间。因此,询问是否“启用”UDP 传输并不是一个真正有效的问题。任何一系列位都可以通过 UDP、TCP 或任何其他协议发送 - 这意味着 UDP 甚至不理解 ASCII 是什么、字母“b”或回车符是什么。它只是一堆 1 和 0,UDP 知道 IP 地址和端口号 - 足以将您的数据位发送到某个地方。问题是您的应用程序如何处理这些位。

Eh, that's not entirely accurate. UDP isn't differentiated by virtue of sending text vs. binary. All network protocols ultimately send data as bit streams (binary). What typically differentiates it is that unlike TCP, there is no back and forth to establish sequence numbers for tracking packets, and no ACK flag to signal that a packet was received. UDP will send packets with no regard to whether or not they get to the destination.

Edit: Ray maybe you should provide a little more detail about what you're trying to do. Carriage Return is an ascii character just like any other. It has a numerical representation and occupies a byte of space just like the other ascii characters. So asking if it's "enabled" for UDP transmission isn't really a valid question. Any series of bits can be sent via UDP, or TCP, or any other protocol - which means UDP doesn't even understand what ASCII is, or the letter "b", or a carriage return. It's all just a bunch of 1's and 0's, and UDP is aware of IP addresses and Port numbers - just enough to send your bits of data somewhere. What your application does with those bits is the question.

流绪微梦 2024-10-27 06:22:21

UDP 流量较少是会话/连接。所以你不能在 UDP 上建立“连接”。

UDP 用于传递二进制数据而不是文本,并且无法禁用回车符或任何其他字符。

UDP traffic is session/connection less. So you can't have a "connection" on UDP.

UDP is used to pass binary data rather than text and there is no way to disable carriage return or any other character.

铁憨憨 2024-10-27 06:22:21

UDP 广播二进制数据 - 如果将 \r 和/或 \n 编码为字节并将其添加到消息中,则会发送该数据。该协议层上没有过滤、没有转换。

UDP broadcasts binary data - if you encode \r and/or \n to bytes and add it to the message, it will be sent. No filtering, no conversion on this protocol layer.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文