diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-05-27 11:35:54 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-05-27 11:35:54 +0100 |
commit | 072102cfd23c47d36f4d51875026339a767f22ae (patch) | |
tree | 3005737650989527f71b2c742696e6dfb0a2a7f6 /contrib/epee/include/net/abstract_tcp_server.h | |
parent | Merge pull request #2015 (diff) | |
download | monero-072102cfd23c47d36f4d51875026339a767f22ae.tar.xz |
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.
Diffstat (limited to 'contrib/epee/include/net/abstract_tcp_server.h')
-rw-r--r-- | contrib/epee/include/net/abstract_tcp_server.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/contrib/epee/include/net/abstract_tcp_server.h b/contrib/epee/include/net/abstract_tcp_server.h index 1efd5091c..000305cfa 100644 --- a/contrib/epee/include/net/abstract_tcp_server.h +++ b/contrib/epee/include/net/abstract_tcp_server.h @@ -296,7 +296,7 @@ namespace net_utils } //---------------------------------------------------------------------------------------- template<class THandler> - bool abstract_tcp_server<THandler>::invoke_connection(SOCKET hnew_sock, long ip_from, int post_from) + bool abstract_tcp_server<THandler>::invoke_connection(SOCKET hnew_sock, const network_address &remote_address) { m_connections_lock.lock(); m_connections.push_back(thread_context()); @@ -304,8 +304,7 @@ namespace net_utils m_connections.back().m_socket = hnew_sock; m_connections.back().powner = this; m_connections.back().m_self_it = --m_connections.end(); - m_connections.back().m_context.m_remote_ip = ip_from; - m_connections.back().m_context.m_remote_port = post_from; + m_connections.back().m_context.m_remote_address = remote_address; m_connections.back().m_htread = threads_helper::create_thread(ConnectionHandlerProc, &m_connections.back()); return true; |