s/oio_tcp_handle_accept/oio_accept/
This commit is contained in:
parent
cf4fbc0925
commit
8f6a175e9d
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
2
oio.h
2
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 */
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user