|
OpenTTD Source 20251104-master-g3befbdd52f
|
Template for TCP listeners. More...
#include <tcp_listen.h>
Static Public Member Functions | |
| static bool | ValidateClient (SOCKET s, NetworkAddress &address) |
| static void | AcceptClient (SOCKET ls) |
| Accepts clients from the sockets. | |
| static bool | Receive () |
| Handle the receiving of packets. | |
| static bool | Listen (uint16_t port) |
| Listen on a particular port. | |
| static void | CloseListeners () |
| Close the sockets we're listening on. | |
Static Private Attributes | |
| static SocketList | sockets |
| List of sockets we listen on. | |
Template for TCP listeners.
| Tsocket | The class we create sockets for. |
| Tfull_packet | The packet type to return when we don't allow more sockets. |
| Tban_packet | The packet type to return when the client is banned. |
Definition at line 31 of file tcp_listen.h.
|
inlinestatic |
Accepts clients from the sockets.
| ls | Socket to accept clients from. |
Definition at line 76 of file tcp_listen.h.
References _frame_counter, Debug, NetworkAddress::GetHostname(), SetNoDelay(), and SetNonBlocking().
Referenced by TCPListenHandler< Tsocket, Tfull_packet, Tban_packet >::Receive().
|
inlinestatic |
Close the sockets we're listening on.
Definition at line 166 of file tcp_listen.h.
References Debug, and TCPListenHandler< Tsocket, Tfull_packet, Tban_packet >::sockets.
|
inlinestatic |
Listen on a particular port.
| port | The port to listen on. |
Definition at line 145 of file tcp_listen.h.
References Debug, GetBindAddresses(), and TCPListenHandler< Tsocket, Tfull_packet, Tban_packet >::sockets.
|
inlinestatic |
Handle the receiving of packets.
Definition at line 103 of file tcp_listen.h.
References _networking, TCPListenHandler< Tsocket, Tfull_packet, Tban_packet >::AcceptClient(), and TCPListenHandler< Tsocket, Tfull_packet, Tban_packet >::sockets.
|
inlinestatic |
Definition at line 36 of file tcp_listen.h.
|
staticprivate |
List of sockets we listen on.
Definition at line 33 of file tcp_listen.h.
Referenced by TCPListenHandler< Tsocket, Tfull_packet, Tban_packet >::CloseListeners(), TCPListenHandler< Tsocket, Tfull_packet, Tban_packet >::Listen(), and TCPListenHandler< Tsocket, Tfull_packet, Tban_packet >::Receive().