ext/asyncengine/libuv/src/unix/tcp.c in asyncengine-0.0.1.testing1 vs ext/asyncengine/libuv/src/unix/tcp.c in asyncengine-0.0.2.alpha1
- old
+ new
@@ -48,11 +48,13 @@
if ((tcp->fd = uv__socket(domain, SOCK_STREAM, 0)) == -1) {
uv__set_sys_error(tcp->loop, errno);
goto out;
}
- if (uv__stream_open((uv_stream_t*)tcp, tcp->fd, UV_READABLE | UV_WRITABLE)) {
+ if (uv__stream_open((uv_stream_t*)tcp,
+ tcp->fd,
+ UV_STREAM_READABLE | UV_STREAM_WRITABLE)) {
close(tcp->fd);
tcp->fd = -1;
status = -2;
goto out;
}
@@ -179,11 +181,11 @@
if ((tcp->fd = uv__socket(AF_INET, SOCK_STREAM, 0)) == -1) {
uv__set_sys_error(tcp->loop, errno);
return -1;
}
- if (uv__stream_open((uv_stream_t*)tcp, tcp->fd, UV_READABLE)) {
+ if (uv__stream_open((uv_stream_t*)tcp, tcp->fd, UV_STREAM_READABLE)) {
close(tcp->fd);
tcp->fd = -1;
return -1;
}
}
@@ -197,12 +199,11 @@
}
tcp->connection_cb = cb;
/* Start listening for connections. */
- ev_io_set(&tcp->read_watcher, tcp->fd, EV_READ);
- ev_set_cb(&tcp->read_watcher, uv__server_io);
- ev_io_start(tcp->loop->ev, &tcp->read_watcher);
+ uv__io_set(&tcp->read_watcher, uv__server_io, tcp->fd, UV__IO_READ);
+ uv__io_start(tcp->loop, &tcp->read_watcher);
return 0;
}