10#ifndef NETWORK_CORE_TCP_TURN_H
11#define NETWORK_CORE_TCP_TURN_H
29 static constexpr bool value =
true;
NetworkTCPSocketHandler(SOCKET s=INVALID_SOCKET)
Construct a socket handler for a TCP connection.
virtual bool ReceiveClientConnect(Packet &p)
Client (or OpenTTD server) wants to connect to the TURN server (on request by the Game Coordinator).
virtual bool ReceiveServerError(Packet &p)
TURN server was unable to connect the client or server based on the token.
virtual bool ReceiveServerConnected(Packet &p)
TURN server has connected client and OpenTTD server together and will now relay all packets to each o...
bool ReceivePackets()
Receive a packet at TCP level.
bool ReceiveInvalidPacket(PacketTurnType type)
Helper for logging receiving invalid packets.
bool HandlePacket(Packet &p)
Handle the given packet, i.e.
NetworkTurnSocketHandler(SOCKET s=INVALID_SOCKET)
Create a new cs socket handler for a given cs.
Convert NetworkGameInfo to Packet and back.
Includes and/or implementations for the network stuff.
Basic functions to create, fill and read packets.
static constexpr bool value
This is an enumeration of a PacketType.
Trait to mark an enumeration as a PacketType.
Basic functions to receive and send TCP packets.
PacketTurnType
Enum with all types of TCP TURN packets.
@ ServerError
TURN server is unable to relay.
@ ServerConnected
TURN server indicates the socket is now being relayed.
@ ClientConnect
Client (or OpenTTD server) is connecting to the TURN server.