文件名称:socket-server-socket-serve
- 所属分类:
- Internet/网络编程
- 资源属性:
- [C/C++] [源码]
- 上传时间:
- 2017-07-07
- 文件大小:
- 11kb
- 下载次数:
- 0次
- 提 供 者:
- JIE2****
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
这是一个关于各种IO模型的socket server实现与测试。
这里采用多种模型实现了一个TCP ECHO服务器,将client发送的内容echo回去。
client每秒会发送一次请求,server保持并发连接并进行相应。
现已实现的模型:
base: 最原始的echo服务器
thread: 多线程模型
select: select模型
poll: poll模型
epoll: epoll模型
参数
修改src/clients.sh 可以生成指定数量的client
修改src/base.cpp 中的MAX_CLIENT_NUM参数调整server最大服务数
修改src/base.cpp 中的CLIENT_INTERVAL参数调整client发包间隔
修改Makefile 中的DEBUG参数确定是否输出调试信息
使用方法(This is a socket server implementation and testing of various IO models.
Here, a variety of models are used to implement a TCP ECHO server that returns the contents sent by echo back to client.
Client sends a request per second, and server maintains concurrent connections and performs them accordingly.
The model has been implemented:
Base: the most primitive echo server
Thread: multithreaded model
Select: select model
Poll: poll model
Epoll: epoll model
parameter
Modify src/clients.sh to generate a specified number of client
Modify the MAX_CLIENT_NUM parameter in src/base.cpp to adjust the maximum number of server services
Modify the CLIENT_INTERVAL parameter in src/base.cpp to adjust the client contract interval
Modify the DEBUG parameter in the Makefile to determine whether output debugging information is out
Usage method)
这里采用多种模型实现了一个TCP ECHO服务器,将client发送的内容echo回去。
client每秒会发送一次请求,server保持并发连接并进行相应。
现已实现的模型:
base: 最原始的echo服务器
thread: 多线程模型
select: select模型
poll: poll模型
epoll: epoll模型
参数
修改src/clients.sh 可以生成指定数量的client
修改src/base.cpp 中的MAX_CLIENT_NUM参数调整server最大服务数
修改src/base.cpp 中的CLIENT_INTERVAL参数调整client发包间隔
修改Makefile 中的DEBUG参数确定是否输出调试信息
使用方法(This is a socket server implementation and testing of various IO models.
Here, a variety of models are used to implement a TCP ECHO server that returns the contents sent by echo back to client.
Client sends a request per second, and server maintains concurrent connections and performs them accordingly.
The model has been implemented:
Base: the most primitive echo server
Thread: multithreaded model
Select: select model
Poll: poll model
Epoll: epoll model
parameter
Modify src/clients.sh to generate a specified number of client
Modify the MAX_CLIENT_NUM parameter in src/base.cpp to adjust the maximum number of server services
Modify the CLIENT_INTERVAL parameter in src/base.cpp to adjust the client contract interval
Modify the DEBUG parameter in the Makefile to determine whether output debugging information is out
Usage method)
相关搜索: socket
(系统自动生成,下载前可以参看下载内容)
下载文件列表
socket-server-master
socket-server-master\.gitignore
socket-server-master\.travis.yml
socket-server-master\Dockerfile
socket-server-master\LICENSE
socket-server-master\Makefile
socket-server-master\README.md
socket-server-master\src
socket-server-master\src\base.cpp
socket-server-master\src\base.h
socket-server-master\src\base_server.cpp
socket-server-master\src\client.cpp
socket-server-master\src\clients.sh
socket-server-master\src\epoll_server.cpp
socket-server-master\src\poll_server.cpp
socket-server-master\src\select_server.cpp
socket-server-master\src\thread_server.cpp
socket-server-master\.gitignore
socket-server-master\.travis.yml
socket-server-master\Dockerfile
socket-server-master\LICENSE
socket-server-master\Makefile
socket-server-master\README.md
socket-server-master\src
socket-server-master\src\base.cpp
socket-server-master\src\base.h
socket-server-master\src\base_server.cpp
socket-server-master\src\client.cpp
socket-server-master\src\clients.sh
socket-server-master\src\epoll_server.cpp
socket-server-master\src\poll_server.cpp
socket-server-master\src\select_server.cpp
socket-server-master\src\thread_server.cpp