网上搜索的几篇优秀的关于socket的文章
纯c++版的
注意添加头文件
#include <unistd.h>
#include <sys/select.h>
cocos2d-x 扩展版的
coocs2dx 简易封装的
cocos2d-x BSD版