OpenTTD Source
12.0-beta2
|
Go to the documentation of this file.
10 #ifndef NETWORK_STUN_H
11 #define NETWORK_STUN_H
31 static std::unique_ptr<ClientNetworkStunSocketHandler>
Stun(
const std::string &
token, uint8
family);
TCPConnecter * connecter
Connecter instance.
"Helper" class for creating TCP connections in a non-blocking manner
uint8 family
Family of this STUN handler.
NetworkAddress local_addr
Local addresses of the socket.
void Connect(const std::string &token, uint8 family)
Connect to the STUN server over either IPv4 or IPv6.
std::string token
Token of this STUN handler.
NetworkRecvStatus CloseConnection(bool error=true) override
This will put this socket handler in a close state.
Wrapper for (un)resolved network addresses; there's no reason to transform a numeric IP to a string a...
void SendReceive()
Check whether we received/can send some data from/to the STUN server and when that's the case handle ...
NetworkRecvStatus
Status of a network client; reasons why a client has quit.
static std::unique_ptr< ClientNetworkStunSocketHandler > Stun(const std::string &token, uint8 family)
Send a STUN packet to the STUN server.
void CDECL error(const char *s,...)
Error handling for fatal non-user errors.
bool sent_result
Did we sent the result of the STUN connection?
Base socket handler for all STUN TCP sockets.
Class for handling the client side of the STUN connection.