我发现了奇怪的问题。谁能告诉我为什么? [英] I found strange problems. Who can tell me why?

查看:75
本文介绍了我发现了奇怪的问题。谁能告诉我为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在TCP / IP通信中发现了一些奇怪的问题。

据我所知,在TCP / IP通信中,检查发送的所有数据包是否正确地从发送方到达接收方。并且在UDP通信中检查过程被省略。

但我发现TCP / IP检查例程不起作用。

我正在使用TCP开发客户端和NodeJS服务器之间的通信程序/ C ++的IP协议。

但有时,数据包不会发送到服务器或客户端。

当网络繁忙或许多客户端尝试与服务器通信时会出现这些问题。



谁能告诉我为什么?

解决方案

我不认为这是问题所在; (很难假设TCP堆栈的实现是如此有缺陷。)



如果你的逻辑是这样的:

发送一个

发送b

发送c



和接收器接收a和c,然后它可能是。



但是,我认为接收方没有收到c,这意味着发送方仍然有c(它被认为没有发送),而你的发送方可能需要重新连接再次发送。



您的应用必须验证发送命令的结果会发生什么,并取决于您下次使用未发送的数据做什么。

I found some strange problems in TCP/IP communication.
As I know, in TCP/IP communications all the packets sent are checked whether they are correctly arrived to receiver from sender. And in UDP communications checking process is omitted.
But I found that TCP/IP checking routine does not work.
I am developing communication program between client and NodeJS server using TCP/IP protocol by C++.
But sometimes, packets are not sent to server or to client.
These problems occur when network is busy or many clients try to communicate with server.

Who can tell me why?

解决方案

I don't think that is the problem; (it is hard to assume that the TCP stack implementation is so flawed).

If your logic is like this:
send a
send b
send c

and the receiver receives a and c, then it might be.

However, I assume that the receiver doesn't receive c, which means that the sender still has c (it is considered not sent), and you sender might need a reconnect to send again.

Your app must verify what happens with the result of a send command, and depends on you what to do next with the data not sent.


这篇关于我发现了奇怪的问题。谁能告诉我为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆