fiber for windows OS can use IO read/write with timed waiting by using select/poll;

ACL_VSTREAM's NETWORK IO read/write interface can be hooked by user's IO API.
This commit is contained in:
zsx 2018-01-14 23:08:04 +08:00
parent 768d30a56c
commit bc845a5dcd
3 changed files with 3 additions and 3 deletions

View File

@ -118,7 +118,7 @@ ACL_API int acl_fifo_listen(const char *path, int permissions, int mode);
#if defined(_WIN32) || defined(_WIN64)
typedef SOCKET (__stdcall *acl_accept_fn)(SOCKET, struct sockaddr*, socklen_t*);
#else
typedef int (acl_accept_fn)(int, struct sockaddr*, socklen_t*);
typedef int (*acl_accept_fn)(int, struct sockaddr*, socklen_t*);
#endif
ACL_API void acl_set_accept(acl_accept_fn fn);

View File

@ -251,7 +251,7 @@ static acl_poll_fn __sys_poll = poll;
void acl_set_poll(acl_poll_fn fn)
{
__sys_poll == fn;
__sys_poll = fn;
}
int acl_read_poll_wait(ACL_SOCKET fd, int delay)

View File

@ -116,7 +116,7 @@ static struct pollfd *pfds_create(int *nfds, fd_set *readfds,
int fd;
struct pollfd *fds;
fds = (struct pollfd *) calloc(*nfds + , sizeof(struct pollfd));
fds = (struct pollfd *) calloc(*nfds + 1, sizeof(struct pollfd));
for (fd = 0; fd < *nfds; fd++) {
if (readfds && FD_ISSET(fd, readfds)) {