# A lightweight epoll wrap for read multi-sockets
## api
```C
// create a pool , listen on port , set max connection and , buffer size (0 for default 1M bytes)
struct mread_pool * mread_create(int port , int max , int buffer);
// release the pool
void mread_close(struct mread_pool *m);
// poll the poll, timeout (in milliseconds) can be -1 for indefinitely.
// return id (which socket can read) , -1 for block
int mread_poll(struct mread_pool *m , int timeout);
// pull data from the id return by poll.
// return size of buffer or NULL
void * mread_pull(struct mread_pool *m , int size);
// When you don't need use the data return by pull, you must call yield
// Otherwise, you will get them again after next poll
void mread_yield(struct mread_pool *m);
// When the id is closed, it returns 1
int mread_closed(struct mread_pool *m);
// Close id
void mread_close_client(struct mread_pool *m, int id);
// Get the socket fd bind with id , you can use it for sending.
int mread_socket(struct mread_pool *m , int id);
```
没有合适的资源?快使用搜索试试~ 我知道了~
mread-master.zip_mread-master_zip
共18个文件
c:4个
h:2个
md:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 37 浏览量
2022-09-24
22:38:06
上传
评论
收藏 14KB ZIP 举报
温馨提示
mread-master testringbuffer
资源推荐
资源详情
资源评论
收起资源包目录
mread-master.zip (18个子文件)
mread-master
main.c 608B
mread.c 12KB
ringbuffer.c 7KB
LICENSE 1KB
testringbuffer.c 2KB
mread.h 460B
Makefile 117B
ringbuffer.h 1KB
README.md 1KB
prj
mread-master.PR 2KB
mread-master.IAD 368B
mread-master.IMD 368B
mread-master.PFI 24B
mread-master.PO 776B
mread-master.IMB 4KB
mread-master.PS 51KB
mread-master.PRI 12KB
mread-master.IAB 4KB
共 18 条
- 1
资源评论
weixin_42653672
- 粉丝: 93
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功