🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: cn.bbs.comp.winsock
1 messages
1 total messages Started by ��Թ�޻� Tue, 26 Oct 1999 00:00
Re: һ����ֵ�����
#56
Author: ��Թ�޻�
Date: Tue, 26 Oct 1999 00:00
29 lines
1722 bytes
> ==> Baggio_Luo(��.���Ǽ���)                  ˵��: 
>           GetLastError() returns last Win32 API's error code, 
>      so you should immediately call it before another Win32 API 
>      is called.But here you called AfxMessageBox() and it internally 
>      call Win32 API:MessageBox(),so the error code you got was the 
>      result of AfxMessageBox(),not Connect().2nd point,I think you  
>      should call WSAGetLastError() since winsock recommend it.3rd 
>      point,even the zero value of Connect()'s return code doesn't 
>      mean that there's no data sent.It may also mean that the  
>      operation is blocked now but will be sent anyway(and you will 
>      get WSAEWOULDBLOCK as the error code).        
>     
>   
You are great!Thank you!

Now I have corrected it by override OnConnect(...),
during OnConnect(...),nErrorCode==0,it shows that there is no error,
and after Connect(...) I called GetLastError(...) it showed
WSAEWOULDBLOCK error, which is no problem.


to the first point you said,I have a word to say:
the GetLastError(...) I called is the member function of
class CAsyncSocket,will it return the result of AfxMessageBox(..)?

I am a newer,Thank you for your help!

--
�� ��Դ: �й�ƴ�BBSվ [bbs.ustc.edu.cn]
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads