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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user