void CRouteConn::OnConnect(net_handle_t handle) { m_handle = handle; g_route_conn_map.insert(make_pair(handle, this)); netlib_option(handle, NETLIB_OPT_SET_CALLBACK, (void*)imconn_callback); netlib_option(handle, NETLIB_OPT_SET_CALLBACK_DATA, (void*)&g_route_conn_map); }
void CHttpConn::OnConnect(net_handle_t handle) { printf("OnConnect, handle=%d\n", handle); m_sock_handle = handle; m_state = CONN_STATE_CONNECTED; g_http_conn_map.insert(make_pair(m_conn_handle, this)); netlib_option(handle, NETLIB_OPT_SET_CALLBACK, (void*)httpconn_callback); netlib_option(handle, NETLIB_OPT_SET_CALLBACK_DATA, reinterpret_cast<void *>(m_conn_handle) ); netlib_option(handle, NETLIB_OPT_GET_REMOTE_IP, (void*)&m_peer_ip); }
void CHttpConn::OnConnect(net_handle_t handle) { Logger.Log(INFO, "OnConnect, handle=%d\n", handle); m_sockHandle = handle; m_state = CONN_STATE_CONNECTED; g_httpConnMap.insert(make_pair(handle, this)); netlib_option(handle, NETLIB_OPT_SET_CALLBACK, (void*)HttpConnCallback); netlib_option(handle, NETLIB_OPT_SET_CALLBACK_DATA, reinterpret_cast<void *>(m_uuid) ); netlib_option(handle, NETLIB_OPT_GET_REMOTE_IP, (void*)&m_peerIp); }