20#include "socket_tcp_listen.h"
23listener_thread_name(
const std::string &thread_name) {
24 if (!thread_name.empty()) {
27 return "ListenerThread";
35 const std::string &thread_name) :
44void ConnectionListener::
47 <<
"ConnectionListener::receive_datagram called.\n";
54bool ConnectionListener::
55process_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);
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);
The primary interface to the low-level networking layer in this package.
This is an abstract base class for a family of classes that listen for activity on a socket and respo...
Represents a single TCP or UDP socket for input or output.
Represents a network address to which UDP packets may be sent or to which a TCP socket may be bound.
A specific kind of Datagram, especially for sending across or receiving from a network.
A simple place to store and manipulate tcp and port address for communication layer.
static int GetLastError()
Gets the last errcode from a socket operation.
Base functionality for a TCP rendezvous socket.
Base functionality for a TCP connected socket This class is pretty useless by itself but it does hide...
static void force_yield()
Suspends the current thread for the rest of the current epoch.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.