Mread
Multi-Read from one bind port
Install / Use
/learn @cloudwu/MreadREADME
A lightweight epoll wrap for read multi-sockets
api
// 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);
Related Skills
node-connect
343.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
92.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
