diff --git a/src/net.cc b/src/net.cc index a5e8c2eb35..0df94bbb97 100644 --- a/src/net.cc +++ b/src/net.cc @@ -94,12 +94,12 @@ Connection::Connection (Handle handle) port_ = NULL; oi_socket_init(&socket_, timeout); - socket_.on_connect = Connection::_OnConnect; - socket_.on_read = Connection::_OnReceive; - socket_.on_drain = Connection::_OnDrain; - socket_.on_error = Connection::_OnError; - socket_.on_close = Connection::_OnDisconnect; - socket_.on_timeout = Connection::_OnTimeout; + socket_.on_connect = Connection::on_connect; + socket_.on_read = Connection::on_read; + socket_.on_drain = Connection::on_drain; + socket_.on_error = Connection::on_error; + socket_.on_close = Connection::on_close; + socket_.on_timeout = Connection::on_timeout; socket_.data = this; } @@ -370,8 +370,8 @@ Acceptor::Acceptor (Handle handle, Handle options) } oi_server_init(&server_, backlog); - server_.on_connection = Acceptor::_OnConnection; - server_.on_error = Acceptor::_OnError; + server_.on_connection = Acceptor::on_connection; + server_.on_error = Acceptor::on_error; server_.data = this; } diff --git a/src/net.h b/src/net.h index 3876acf6b8..38cd43321e 100644 --- a/src/net.h +++ b/src/net.h @@ -53,12 +53,13 @@ protected: v8::Handle server); private: - static void _OnConnect (oi_socket *s) { + /* liboi callbacks */ + static void on_connect (oi_socket *s) { Connection *connection = static_cast (s->data); connection->OnConnect(); } - static void _OnReceive (oi_socket *s, const void *buf, size_t len) { + static void on_read (oi_socket *s, const void *buf, size_t len) { Connection *connection = static_cast (s->data); if (len == 0) connection->OnEOF(); @@ -66,22 +67,22 @@ private: connection->OnReceive(buf, len); } - static void _OnDrain (oi_socket *s) { + static void on_drain (oi_socket *s) { Connection *connection = static_cast (s->data); connection->OnDrain(); } - static void _OnError (oi_socket *s, oi_error e) { + static void on_error (oi_socket *s, oi_error e) { Connection *connection = static_cast (s->data); connection->OnError(e); } - static void _OnDisconnect (oi_socket *s) { + static void on_close (oi_socket *s) { Connection *connection = static_cast (s->data); connection->OnDisconnect(); } - static void _OnTimeout (oi_socket *s) { + static void on_timeout (oi_socket *s) { Connection *connection = static_cast (s->data); connection->OnTimeout(); } @@ -124,7 +125,7 @@ protected: static v8::Handle v8Close (const v8::Arguments& args); private: - static oi_socket* _OnConnection (oi_server *s, struct sockaddr *addr, socklen_t len) { + static oi_socket* on_connection (oi_server *s, struct sockaddr *addr, socklen_t len) { Acceptor *acceptor = static_cast (s->data); Connection *connection = acceptor->OnConnection (addr, len); if (connection) @@ -133,7 +134,7 @@ private: return NULL; } - static void _OnError (oi_server *s, struct oi_error error) { + static void on_error (oi_server *s, struct oi_error error) { Acceptor *acceptor = static_cast (s->data); acceptor->OnError (error); }