CAsyncSocket
-
Hello all, I have CAsyncSocket class I have rewritten the virtual member function OnReceive: void CCommunication::OnReceive( int nErrorCode ) { if( nErrorCode == WSAENETDOWN ){ ASSERT( 0 ); return; } // do my useful task // parent CAsyncSocket::OnReceive( nErrorCode ); } This clas is used in main dialog window. Sometimes I am loosing packets ... Why? All packets are on the ethernet but I dont receive some of them. For example: There are 4 packets on the ETH but I receive only first three. This happens about three seconds after application start on Cel.900MHz@256MbRAM, and when I drag the main window by the title bar on the SempronMobile 3000+@704MbRAM The application is MFC dialog based. The communication is UDP. Thank you for any suggestion ... xSoptik
-
Hello all, I have CAsyncSocket class I have rewritten the virtual member function OnReceive: void CCommunication::OnReceive( int nErrorCode ) { if( nErrorCode == WSAENETDOWN ){ ASSERT( 0 ); return; } // do my useful task // parent CAsyncSocket::OnReceive( nErrorCode ); } This clas is used in main dialog window. Sometimes I am loosing packets ... Why? All packets are on the ethernet but I dont receive some of them. For example: There are 4 packets on the ETH but I receive only first three. This happens about three seconds after application start on Cel.900MHz@256MbRAM, and when I drag the main window by the title bar on the SempronMobile 3000+@704MbRAM The application is MFC dialog based. The communication is UDP. Thank you for any suggestion ... xSoptik
xSoptik wrote: All packets are on the ethernet but I dont receive some of them. For example: There are 4 packets on the ETH but I receive only first three. That's one of the down falls to using datagram sockets (UDP). Search the MSDN for more information. Here is a quick article there detailing the potention problems. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_Windows_Sockets.3a_.Ports_and_Socket_Addresses.asp[^] Hope this helps... ------------------------------- DEBUGGING : Removing the needles from the haystack.