mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-11-30 10:57:34 +08:00
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:
parent
768d30a56c
commit
bc845a5dcd
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user