http://blog.csdn.net/fangjian1204/article/details/34415651
该http服务器已经可以处理并发连接,支持多个客户端并发访问,每个连接可以持续读写数据,当然,这只是一个简单的学习例子,还有很多bug,发表出来只是希望大家可以互相学习,我也在不断的改进,希望大家有什么意见可以多多指点,谢谢
server.h
[cpp] view plaincopy
server.cpp
[cpp] view plaincopy
epoll_event.h
[cpp] view plaincopy
epoll_event.cpp
[cpp] view plaincopy
使用方法:
服务器使用方法:直接运行即可 客户端使用方法:编译客户端代码,然后 ./client 127.0.0.1 8083 5(最后一个代表客户端进程数) 本程序在linux平台下测试成功
免费代码下载地址:http://download.csdn.net/detail/fangjian1204/7575477