diff --git a/oio-unix.c b/oio-unix.c index 78e9f0a0..f89f46f6 100644 --- a/oio-unix.c +++ b/oio-unix.c @@ -248,7 +248,7 @@ void oio__server_io(EV_P_ ev_io* watcher, int revents) { handle->accepted_fd = fd; handle->accept_cb(handle); if (handle->accepted_fd >= 0) { - /* The user hasn't yet accepted called oio_tcp_handle_accept() */ + /* The user hasn't yet accepted called oio_accept() */ ev_io_stop(EV_DEFAULT_ &handle->read_watcher); return; } @@ -257,7 +257,7 @@ void oio__server_io(EV_P_ ev_io* watcher, int revents) { } -int oio_tcp_handle_accept(oio_handle* server, oio_handle* client, +int oio_accept(oio_handle* server, oio_handle* client, oio_close_cb close_cb, void* data) { if (server->accepted_fd < 0) { return -1; diff --git a/oio-win.c b/oio-win.c index a49e7edd..494df56d 100644 --- a/oio-win.c +++ b/oio-win.c @@ -371,7 +371,7 @@ int oio_tcp_handle_init(oio_handle *handle, oio_close_cb close_cb, } -int oio_tcp_handle_accept(oio_handle* server, oio_handle* client, +int oio_accept(oio_handle* server, oio_handle* client, oio_close_cb close_cb, void* data) { if (!server->accepted_socket == INVALID_SOCKET) { oio_errno_ = WSAENOTCONN; diff --git a/oio.h b/oio.h index bcd1a883..1e443009 100644 --- a/oio.h +++ b/oio.h @@ -130,7 +130,7 @@ int oio_shutdown(oio_req* req); int oio_listen(oio_handle* handle, int backlog, oio_accept_cb cb); /* Call this after accept_cb. client does not need to be initialized. */ -int oio_tcp_handle_accept(oio_handle* server, oio_handle* client, +int oio_accept(oio_handle* server, oio_handle* client, oio_close_cb close_cb, void* data); /* Generic handle methods */ diff --git a/test/echo-server.c b/test/echo-server.c index 817684b8..b38af28d 100644 --- a/test/echo-server.c +++ b/test/echo-server.c @@ -85,8 +85,8 @@ void on_close(oio_handle* peer, oio_err err) { void on_accept(oio_handle* server) { peer_t* p = (peer_t*)calloc(sizeof(peer_t), 1); - if (oio_tcp_handle_accept(server, &p->handle, on_close, (void*)p)) { - FATAL("oio_tcp_handle_accept failed"); + if (oio_accept(server, &p->handle, on_close, (void*)p)) { + FATAL("oio_accept failed"); } p->buf.base = (char*)&p->read_buffer;