开发工具:
文件大小: 332kb
下载次数: 0
上传时间: 2010-04-29
详细说明: 不错的ftp服务器源码,界面很不错。 //工作者线程处理函数 UINT ProcessTreadIO(LPVOID lpParameter) { DWORD dwFlags; LPSOCKET_INF pSI; DWORD dwBytesTransferred; DWORD i; CServer * server=(CServer*)lpParameter; //处理异步的WSASend, WSARecv等请求等 while(TRUE) { if ((g_index = WSAWaitForMultipleEvents(g_dwEventTotal, g_events, FALSE, WSA_INFINITE, FALSE)) == WSA_WAIT_FAILED) { printf("错误:WSAWaitForMultipleEvents failed %d\n", WSAGetLastError()); return 0; } if ((g_index - WSA_WAIT_EVENT_0) == 0) { WSAResetEvent(g_events[0]); continue; } pSI = g_sockets[g_index - WSA_WAIT_EVENT_0]; WSAResetEvent(g_events[g_index - WSA_WAIT_EVENT_0]); if (WSAGetOverlappedResult(pSI->s, &(pSI->o), &dwBytesTransferred, FALSE, &dwFlags) == FALSE || dwBytesTransferred == 0) { printf("Closing socket %d\n", pSI->s); if (closesocket(pSI->s) == SOCKET_ERROR) { printf("错误:closesocket() failed with error %d\n", WSAGetLastError()); } GlobalFree(pSI); WSACloseEvent(g_events[g_index - WSA_WAIT_EVENT_0]); // Cleanup g_sockets and g_events by removing the socket event handle // and socket information structure if they are not at the end of the // arrays. EnterCriticalSection(&g_cs); if ((g_index - WSA_WAIT_EVENT_0) + 1 != g_dwEventTotal) for (i = g_index - WSA_WAIT_EVENT_0; i < g_dwEventTotal; i++) { g_events[i] = g_events[i + 1]; g_sockets[i] = g_sockets[i + 1]; } g_dwEventTotal--; LeaveCriticalSection(&g_cs); continue; ...展开收缩
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.