#include <stdio.h>
#include <winsock2.h>
#pragma comment(lib,"ws2_32.lib")
#pragma comment(lib,"mswsock.lib")
#define MEMSIZE_STR 1024
char * sendBuf = (char *)malloc(MEMSIZE_STR); //发送缓存
char * recvBuf = (char *)malloc(MEMSIZE_STR); //接收缓存
SOCKADDR_IN addrClient;
SOCKADDR_IN addSrv;
void Setioctlsocket(SOCKET s) //设置非阻塞模式
{
unsigned long flag=1;
ioctlsocket(s,FIONBIO,(unsigned long*)&flag);
}
bool Getioctlsocket(SOCKET s) //检测结果,设置阻塞模式
{
bool TheFlag=false;
struct timeval timeout;
fd_set sets;
FD_ZERO(&sets);
FD_SET(s,&sets);
timeout.tv_sec=10; //超时10秒
timeout.tv_usec=0;
int result=select(0,0,&sets,0,&timeout);
if(result<=0)
TheFlag&#