主要参考了3处:
1. libev官方手册: http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod
2.lengzijian的博客: http://blog.csdn.net/lengzijian/article/details/8315133
3.公司自己的项目
----
/*
* @author : wusuopubupt
* @date : 2014-09-04
* @desc : tiny socket server implemented by libev
* to use this, you should install libev at first.
*
* server: just run the program
* client: telnet localhost 8080
*
* @refer : 1). http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod
* 2). http://blog.csdn.net/lengzijian/article/details/8315133
*
*/
#include <ev.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <netinet/in.h>
#include <unistd.h>
#define PORT 8080
#define BUFFER_SIZE 1024
#define MAX_CONNECTIONS 10
struct ev_io *libevlist[MAX_CONNEC