Socke基类:
包括Socket的初始化,主要是windows上,在android上就不需要了
如果平台为windows,则需要初始化
- SocketBase::SocketBase()
- {
- _bInitSuccess=false;
- #if(CC_TARGET_PLATFORM==CC_PLATFORM_WIN32)
- WORDwVersionRequested;
- wVersionRequested=MAKEWORD(2,0);
- WSADATAwsaData;
- intnRet=WSAStartup(wVersionRequested,&wsaData);
- if(nRet!=0)
- fprintf(stderr,"InitilizeError!\n");
- return;
- }
- _bInitSuccess=true;
- #endif
- }
当然析构时也要释放资源