Windows插座随机接受和接收
Windows socket accepting and receiving at random
我刚刚完成了我的跨平台套接字包装器。它在Linux上很好地工作,但是在窗口上我会得到一个非常奇怪的行为。
当我启动服务器(在Loopback端口4242上(时,程序开始接受随机来源的连接并从这些连接中接收。
我终端中记录的内容的示例(这持续发生在非常高的速度上(:
New client connected : 0.0.0.0:58030
Forwarding connection to worker in threadpool...
Waiting for client request...
New client connected : 0.0.0.0:58031
Received 4294967295 bytes from client ''
Forwarding connection to worker in threadpool...
Waiting for client request...
New client connected : Waiting for client request...
Received 4294967295 bytes from client ''0.0.0.0:Received 4294967295 bytes from client ''
58032
Waiting for client request...
Waiting for client request...
Received 4294967295 bytes from client ''
Received 4294967295 bytes from client ''Forwarding connection to worker in threadpool...
在这里,我们可以看到3个连接被接受表格0.0.0.0:58030
,0.0.0.0:58031
和0.0.0.0:58032
。对于每个连接,Recv
返回大量字节读取,但实际的缓冲区为空。
有什么想法导致这种行为使我的研究定向?
4294967295是-1铸件。因此,您可能会得到-1可能表示某些套接字错误,并将其视为无符号数字的字节。
相关文章:
- 为什么随机数生成器不在void函数中随机化数字,而在main函数中随机化
- 在VS代码中交叉编译Windows与Linux上的MinGW的SDL程序
- 为什么 Serial.println(<char[]>);返回随机字符?
- 在Linux for Windows上编译C++代码时出错
- 字符串-C++后显示的随机字符
- 在Windows上用C++裁剪HBITMAP
- C++ Windows 驱动程序MSB3030无法复制该文件,因为它找不到
- 如何加载(或映射)文件部分的最大大小,但适合在Windows上的RAM
- std::threads可以从Windows DLL中的全局变量创建/销毁吗?
- 循环中的随机函数
- 在c++构造函数中使用随机字符串生成器
- Windows Subsystem for Linux (WSL) 下的间歇性随机"找不到文件"错误
- C/C++ Windows 或 Linux 将随机内存块映射成连续的顺序
- Windows插座随机接受和接收
- 带有ATL子类的Windows 10 64位上的随机崩溃
- PyCharm CE 2017.2.2:APPCRASH 在 Windows 7 上随机"Python has stopped working"
- 当Windows XP(32位,SP3)播放声音时,随机应用程序暂停半秒钟
- 在Windows上等待进程随机失败
- 32位Qt应用程序在Windows 7 x64上随机崩溃
- 在Windows上超时使用select()时出现随机奇怪行为