casyncsocket

Asyncsockets and “silent” disconnections

狂风中的少年 提交于 2020-01-09 08:05:35
问题 I've been using cocoaasyncsocket as a client to a Windows .net server using asyncsocket. I am encoding messages using ProtocolBuffers. Together, these make a great set of tools. However recently I have noticed that if I leave the client connected to the server for a long time - many hours - when I try to make a request for data, the message appears to get sent but never arrives at the server. I'm calling this a "silent" disconnection because I'm not receiving the usual disconnection that I

CAsyncSocket::Close Crashes

吃可爱长大的小学妹 提交于 2019-12-25 04:27:41
问题 Hey, im doing some client/server stuff in a windows service. Pretty much new to this stuff. The problem I'm encountering is that when I try to stop the service through Service Manager, it crashes. I added some MessageBoxes code, to trace where they are crashing and I found that when it closes the listener socket it crashes!!! I tried to run the service as a console application, and by myself called the function which is called SERVICE__CONTROL__STOP event is received so that I may reproduce

how to determine socket interface type

女生的网名这么多〃 提交于 2019-12-13 03:48:44
问题 A little background for the question: I recently had a near-death experience with Microsoft and socket binding. I was testing production code and one of the test PCs kept failing. I eventually suggested that there was a bug in the bind() function, one of the oldest functions out there. I submitted the error (see CAsyncSocket Create's bind implementation has a bug in Visual Studio's Developer Community feedback forum), but got handed off to the Windows team (see "__imp_bind implementation has

C++ Stop CAsyncSocket splitting single large packet to multiple small packets

房东的猫 提交于 2019-12-11 19:47:16
问题 I'm writing a client that connects to a server Sometimes the server send dome special packets to the client with the size of 30kb but on client side I get that 30kb in multiple smaller packets (1kb) so my OnReceive callback calls almost 30 times until I get the full packet. I managed to solve this problem by putting an Sleep(1000) just right before CAsyncSocket::Receive and then I get all 30kb in one single packet but putting Sleep() is a very bad idea. Is there any configuration that I