在调试器中时 Winsock2 数据丢失
我正在将 Winsock2 与重叠 I/O 结合使用。这意味着我正在使用 WSAOVERLAPPED 结构调用 WSARecv,稍后我会使用 WSAWaitForMultipleEvents 等待数据。
我做了一个奇怪的观察,当我用调试器停止它时,我似乎丢失了发送到我的应用程序的任何数据。我认为这些数据会堆积在操作系统中的某个地方,然后在下次调用 WSARecv 时传递。
我的假设是错误的吗?
i am using Winsock2 in conjunction with overlapped I/O. This means i am calling WSARecv with a WSAOVERLAPPED structure and later i wait with WSAWaitForMultipleEvents for data.
I made the strange observation that i seem to loose any data that is send to my application while i am halting it with the debugger. I thought this data would pile up somewhere in the OS and then be delivered on the next call to WSARecv.
Is my assumption false?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
UDP还是TCP?
我假设您每个调用使用单独的重叠结构,每个结构使用单独的事件。
请记住,将重叠 I/O 与事件一起使用并不是特别可扩展,只需将套接字与 I/O 完成端口相关联并完全跳过整个事件就容易得多。
UDP or TCP?
I assume you ARE using a separate OVERLAPPED structure per call and a separate event per structure.
Bear in mind that it's not especially scalable to use the overlapped I/O with events, it's much easier to simply associate the socket with an I/O Completion Port and skip the whole event thing completely.