20 #include "socket_tcp_listen.h"
23 listener_thread_name(
const std::string &thread_name) {
24 if (!thread_name.empty()) {
27 return "ListenerThread";
35 const std::string &thread_name) :
44 void ConnectionListener::
47 <<
"ConnectionListener::receive_datagram called.\n";
54 bool ConnectionListener::
55 process_incoming_data(SocketInfo *sinfo) {
57 DCAST_INTO_R(socket, sinfo->get_socket(),
false);
62 bool got_connection = socket->GetIncomingConnection(*session, addr);
63 #if defined(HAVE_THREADS) && defined(SIMPLE_THREADS)
64 while (!got_connection && socket->
GetLastError() == LOCAL_BLOCKING_ERROR) {
66 got_connection = socket->GetIncomingConnection(*session, addr);
68 #endif // SIMPLE_THREADS
70 if (!got_connection) {
72 <<
"Error when accepting new connection.\n";
80 <<
"Received TCP connection from client " << net_addr
81 <<
" on port " << sinfo->_connection->get_address().get_port()
85 if (_manager !=
nullptr) {
86 _manager->new_connection(new_connection);
88 connection_opened(sinfo->_connection, net_addr, new_connection);