mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 04:33:05 +00:00
fixbug timeout is in milliseconds...
This commit is contained in:
@@ -117,8 +117,8 @@ _read_queue(struct connection_pool * pool, int timeout) {
|
|||||||
int n = epoll_wait(pool->epoll_fd , pool->ev, EPOLLQUEUE, timeout);
|
int n = epoll_wait(pool->epoll_fd , pool->ev, EPOLLQUEUE, timeout);
|
||||||
#elif HAVE_KQUEUE
|
#elif HAVE_KQUEUE
|
||||||
struct timespec timeoutspec;
|
struct timespec timeoutspec;
|
||||||
timeoutspec.tv_sec = timeout;
|
timeoutspec.tv_sec = timeout / 1000;
|
||||||
timeoutspec.tv_nsec = 0;
|
timeoutspec.tv_nsec = (timeout % 1000) * 1000000;
|
||||||
int n = kevent(pool->kqueue_fd, NULL, 0, pool->ev, EPOLLQUEUE, &timeoutspec);
|
int n = kevent(pool->kqueue_fd, NULL, 0, pool->ev, EPOLLQUEUE, &timeoutspec);
|
||||||
#endif
|
#endif
|
||||||
if (n == -1) {
|
if (n == -1) {
|
||||||
|
|||||||
@@ -235,8 +235,8 @@ _read_queue(struct mread_pool * self, int timeout) {
|
|||||||
int n = epoll_wait(self->epoll_fd , self->ev, READQUEUE, timeout);
|
int n = epoll_wait(self->epoll_fd , self->ev, READQUEUE, timeout);
|
||||||
#elif HAVE_KQUEUE
|
#elif HAVE_KQUEUE
|
||||||
struct timespec timeoutspec;
|
struct timespec timeoutspec;
|
||||||
timeoutspec.tv_sec = timeout;
|
timeoutspec.tv_sec = timeout / 1000;
|
||||||
timeoutspec.tv_nsec = 0;
|
timeoutspec.tv_nsec = (timeout % 1000) * 1000000;
|
||||||
int n = kevent(self->kqueue_fd, NULL, 0, self->ev, READQUEUE, &timeoutspec);
|
int n = kevent(self->kqueue_fd, NULL, 0, self->ev, READQUEUE, &timeoutspec);
|
||||||
#endif
|
#endif
|
||||||
if (n == -1) {
|
if (n == -1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user