You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// create a pool , listen on port , set max connection and , buffer size (0 for default 1M bytes)structmread_pool*mread_create(intport , intmax , intbuffer);
// release the poolvoidmread_close(structmread_pool*m);
// poll the poll, timeout (in milliseconds) can be -1 for indefinitely.// return id (which socket can read) , -1 for blockintmread_poll(structmread_pool*m , inttimeout);
// pull data from the id return by poll. // return size of buffer or NULLvoid*mread_pull(structmread_pool*m , intsize);
// When you don't need use the data return by pull, you must call yield// Otherwise, you will get them again after next pollvoidmread_yield(structmread_pool*m);
// When the id is closed, it returns 1intmread_closed(structmread_pool*m);
// Close idvoidmread_close_client(structmread_pool*m, intid);
// Get the socket fd bind with id , you can use it for sending.intmread_socket(structmread_pool*m , intid);