aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/include/net/abstract_tcp_server_cp.inl
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-05-27 11:35:54 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-05-27 11:35:54 +0100
commit072102cfd23c47d36f4d51875026339a767f22ae (patch)
tree3005737650989527f71b2c742696e6dfb0a2a7f6 /contrib/epee/include/net/abstract_tcp_server_cp.inl
parentMerge pull request #2015 (diff)
downloadmonero-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_cp.inl')
-rw-r--r--contrib/epee/include/net/abstract_tcp_server_cp.inl5
1 files changed, 2 insertions, 3 deletions
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<TProtocol>::run_server(int threads_count = 0)
}
//-------------------------------------------------------------
template<class TProtocol>
-bool cp_server_impl<TProtocol>::add_new_connection(SOCKET new_sock, long ip_from, int port_from)
+bool cp_server_impl<TProtocol>::add_new_connection(SOCKET new_sock, const network_address &address_from)
{
PROFILE_FUNC("[add_new_connection]");
@@ -487,8 +487,7 @@ bool cp_server_impl<TProtocol>::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");