我一直在試圖弄清楚這一點,現在我需要幫助,因爲我沒有想法。我WSAEventselect函數返回錯誤號10038WSAEventselect錯誤:10038
代碼:
// Error checking....
if(netEvent.iErrorCode[FD_ACCEPT_BIT] != 0)
{
int temp1 = WSAGetLastError();
emit ClientErrorSignal();
return;
}
// Initializing socket
if((newClient = accept(this->info->socket, NULL, NULL)) == INVALID_SOCKET)
{
int temp2 = WSAGetLastError();
emit ClientErrorSignal();
return;
}
// This is where the error occurs
if(WSAEventSelect(newClient, &this->info->event, FD_READ|FD_CLOSE) == SOCKET_ERROR)
{
int temp3 = WSAGetLastError();
emit ClientErrorSignal();
return;
}
this->info
是傳遞到線程結構。
typedef struct {
SOCKET socket;
int size;
bool isTcp;
WSAEVENT event;
} SINFO, *PSINFO;
accept本身應該初始化`newClient`套接字。這是我感到困惑的,因爲接受並沒有拋出任何錯誤。 – Koralarts 2011-02-13 02:59:18