摘要:
之前写的服务器端 表示都无法收到client发的数据,找不到原因,原来是有个socket接收数据缓冲木有设置,现在设置后就可以正常收到数据啦!server端:#include #include #include #pragma comment(lib, "ws2_32.lib")#define MYPORT 1234 // the port users will be connecting to#define BACKLOG 5 // how many pending connections queue will hold#define BUF_SIZE 200int fd 阅读全文
posted @ 2013-08-25 21:48
hailong
阅读(410)
评论(0)
推荐(0)
摘要:
用select的时候 设置超时时间 就有一些数据收不到,当设置为轮询就可以啦。这不科学啊!为毛?#include #include #include #pragma comment(lib, "ws2_32.lib")#define MYPORT 1234 // the port users will be connecting to#define BACKLOG 5 // how many pending connections queue will hold#define BUF_SIZE 200int fd_A[BACKLOG]; // accepted connec 阅读全文
posted @ 2013-08-25 21:28
hailong
阅读(208)
评论(0)
推荐(0)
摘要:
算法导论第10章的东西,感觉用双链表真心简单,就是有点浪费空间,但是时间复杂度O(1):#include struct LinkNode{ LinkNode(): m_Value(-1) , m_pPreNode(NULL) , m_pNextNode(NULL) { } int m_Value; LinkNode* m_pPreNode; LinkNode* m_pNextNode;};class Queue{public: void Init() { m_pHeadNode = new LinkNod... 阅读全文
posted @ 2013-08-25 15:32
hailong
阅读(350)
评论(0)
推荐(0)

浙公网安备 33010602011771号