OpenTTD
network_udp.h File Reference

Sending and receiving UDP messages. More...

#include "core/address.h"

Go to the source code of this file.

Functions

void NetworkUDPInitialize ()
 Initialize the whole UDP bit. More...
 
void NetworkUDPSearchGame ()
 Find all servers.
 
void NetworkUDPQueryMasterServer ()
 Request the the server-list from the master server.
 
void NetworkUDPQueryServer (NetworkAddress address, bool manually=false)
 Query a specific server. More...
 
void NetworkUDPAdvertise ()
 Register us to the master server This function checks if it needs to send an advertise. More...
 
void NetworkUDPRemoveAdvertise (bool blocking)
 Remove our advertise from the master-server. More...
 
void NetworkUDPClose ()
 Close all UDP related stuff. More...
 
void NetworkBackgroundUDPLoop ()
 Receive the UDP packets. More...
 

Detailed Description

Sending and receiving UDP messages.

Definition in file network_udp.h.

Function Documentation

◆ NetworkBackgroundUDPLoop()

void NetworkBackgroundUDPLoop ( )

Receive the UDP packets.

Definition at line 663 of file network_udp.cpp.

References _network_udp_broadcast, _network_udp_mutex, _network_udp_server, lock, and NetworkUDPSocketHandler::ReceivePackets().

Referenced by NetworkBackgroundLoop().

◆ NetworkUDPAdvertise()

void NetworkUDPAdvertise ( )

Register us to the master server This function checks if it needs to send an advertise.

< The time of the last advertisement (used to check for wrapping of time)

< The next time we should perform a normal advertisement.

< The next time we should perform a retry of an advertisement.

Definition at line 579 of file network_udp.cpp.

References _network_advertise_retries, _network_need_advertise, _network_server, _network_udp_server, _networking, _realtime_tick, _settings_client, ADVERTISE_NORMAL_INTERVAL, ADVERTISE_RETRY_INTERVAL, ADVERTISE_RETRY_TIMES, ClientSettings::network, and NetworkSettings::server_advertise.

◆ NetworkUDPClose()

◆ NetworkUDPInitialize()

void NetworkUDPInitialize ( )

Initialize the whole UDP bit.

Definition at line 619 of file network_udp.cpp.

References DEBUG, and NetworkUDPClose().

Referenced by NetworkDisconnect().

◆ NetworkUDPQueryServer()

void NetworkUDPQueryServer ( NetworkAddress  address,
bool  manually 
)

Query a specific server.

Parameters
addressThe address of the server.
manuallyWhether the address was entered manually.

Definition at line 78 of file network_udp.cpp.

References DoNetworkUDPQueryServer(), NetworkAddress::IsResolved(), and StartNewThread().

Referenced by NetworkGameListRequery().

◆ NetworkUDPRemoveAdvertise()

void NetworkUDPRemoveAdvertise ( bool  blocking)

Remove our advertise from the master-server.

Parameters
blockingwhether to wait until the removal has finished.

Definition at line 527 of file network_udp.cpp.

References _network_server, _network_udp_server, _networking, NetworkUDPRemoveAdvertiseThread(), and StartNewThread().

Referenced by NetworkDisconnect(), and MasterNetworkUDPSocketHandler::Receive_MASTER_ACK_REGISTER().