diff options
author | 2016-10-07 14:15:01 +0200 | |
---|---|---|
committer | 2016-10-07 14:15:01 +0200 | |
commit | c0a5494de53f66d75c98c553cf61e32a5a8d5076 (patch) | |
tree | b1c1685c84e261795bf37a0c9969f80c9fdab705 /src/osd/modules/ipc/rtc_tcp_server.cpp | |
parent | 85f4741fcf642f52ac4fa56f0aff1728727c901b (diff) |
Replaced code usage of libuv with asio library (nw)
Diffstat (limited to 'src/osd/modules/ipc/rtc_tcp_server.cpp')
-rw-r--r-- | src/osd/modules/ipc/rtc_tcp_server.cpp | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/src/osd/modules/ipc/rtc_tcp_server.cpp b/src/osd/modules/ipc/rtc_tcp_server.cpp deleted file mode 100644 index 52345454983..00000000000 --- a/src/osd/modules/ipc/rtc_tcp_server.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Inaki Baz Castillo,Miodrag Milanovic - -#include "rtc_tcp_server.h" -#include <string> - -#define MAX_TCP_CONNECTIONS_PER_SERVER 10 - -/* Instance methods. */ - -rtc_tcp_server::rtc_tcp_server(uv_loop_t* loop, const std::string &ip, uint16_t port, int backlog, listener* listener, rtc_tcp_connection::listener* connListener) : - tcp_server(loop, ip, port, backlog), - m_listener(listener), - m_conn_listener(connListener) -{ -} - -void rtc_tcp_server::user_on_tcp_connection_alloc(tcp_connection** connection) -{ - // Allocate a new rtc_tcp_connection for the rtc_tcp_server to handle it. - *connection = new rtc_tcp_connection(m_conn_listener, 65536); -} - -void rtc_tcp_server::user_on_new_tcp_connection(tcp_connection* connection) -{ - // Allow just MAX_TCP_CONNECTIONS_PER_SERVER. - if (get_num_connections() > MAX_TCP_CONNECTIONS_PER_SERVER) - connection->close(); -} - -void rtc_tcp_server::user_on_tcp_connection_closed(tcp_connection* connection, bool is_closed_by_peer) -{ - // Notify the listener. - // NOTE: Don't do it if closing (since at this point the listener is already freed). - // At the end, this is just called if the connection was remotely closed. - if (!is_closing()) - m_listener->on_rtc_tcp_connection_closed(this, static_cast<rtc_tcp_connection*>(connection), is_closed_by_peer); -} - -void rtc_tcp_server::user_on_tcp_server_closed() -{ -} |