mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-03 05:16:37 +00:00
Servertalk implementation wip, added optional support for pub-key authenticated encryption (via libsodium), not backwards compatible.
This commit is contained in:
@@ -107,12 +107,17 @@ void EQ::Net::TCPConnection::OnDisconnect(std::function<void(TCPConnection*)> cb
|
||||
void EQ::Net::TCPConnection::Disconnect()
|
||||
{
|
||||
if (m_socket) {
|
||||
uv_close((uv_handle_t*)m_socket, on_close_handle);
|
||||
m_socket->data = this;
|
||||
uv_close((uv_handle_t*)m_socket, [](uv_handle_t* handle) {
|
||||
TCPConnection *connection = (TCPConnection*)handle->data;
|
||||
|
||||
if (connection->m_on_disconnect_cb) {
|
||||
connection->m_on_disconnect_cb(connection);
|
||||
}
|
||||
|
||||
delete handle;
|
||||
});
|
||||
m_socket = nullptr;
|
||||
|
||||
if (m_on_disconnect_cb) {
|
||||
m_on_disconnect_cb(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user