From 072102cfd23c47d36f4d51875026339a767f22ae Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sat, 27 May 2017 11:35:54 +0100 Subject: abstracted nework addresses All code which was using ip and port now uses a new IPv4 object, subclass of a new network_address class. This will allow easy addition of I2P addresses later (and also IPv6, etc). Both old style and new style peer lists are now sent in the P2P protocol, which is inefficient but allows peers using both codebases to talk to each other. This will be removed in the future. No other subclasses than IPv4 exist yet. --- contrib/epee/include/net/abstract_tcp_server_cp.inl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'contrib/epee/include/net/abstract_tcp_server_cp.inl') diff --git a/contrib/epee/include/net/abstract_tcp_server_cp.inl b/contrib/epee/include/net/abstract_tcp_server_cp.inl index ba201e3bf..e0ef6470e 100644 --- a/contrib/epee/include/net/abstract_tcp_server_cp.inl +++ b/contrib/epee/include/net/abstract_tcp_server_cp.inl @@ -471,7 +471,7 @@ bool cp_server_impl::run_server(int threads_count = 0) } //------------------------------------------------------------- template -bool cp_server_impl::add_new_connection(SOCKET new_sock, long ip_from, int port_from) +bool cp_server_impl::add_new_connection(SOCKET new_sock, const network_address &address_from) { PROFILE_FUNC("[add_new_connection]"); @@ -487,8 +487,7 @@ bool cp_server_impl::add_new_connection(SOCKET new_sock, long ip_from m_connections_lock.unlock(); conn.init_buffers(); conn.m_sock = new_sock; - conn.context.m_remote_ip = ip_from; - conn.context.m_remote_port = port_from; + conn.context.m_remote_address = address_from; conn.m_completion_port = m_completion_port; { PROFILE_FUNC("[add_new_connection] CreateIoCompletionPort"); -- cgit v1.2.3