OpenTTD Source  20240919-master-gdf0233f4c2
os_abstraction.h File Reference

Go to the source code of this file.

Data Structures

class  NetworkError
 Abstraction of a network error where all implementation details of the error codes are encapsulated in this class and the abstraction layer. More...
 

Functions

bool SetNonBlocking (SOCKET d)
 
bool SetNoDelay (SOCKET d)
 
bool SetReusePort (SOCKET d)
 Try to set the socket to reuse ports. More...
 
NetworkError GetSocketError (SOCKET d)
 Get the error from a socket, if any. More...
 

Detailed Description

Network stuff has many things that needs to be included and/or implemented by default. All those things are in this file.

Definition in file os_abstraction.h.

Function Documentation

◆ GetSocketError()

NetworkError GetSocketError ( SOCKET  d)

Get the error from a socket, if any.

Parameters
dThe socket to get the error from.
Returns
The errno on the socket.

Definition at line 184 of file os_abstraction.cpp.

Referenced by TCPConnecter::CheckActivity().

◆ SetReusePort()

bool SetReusePort ( SOCKET  d)

Try to set the socket to reuse ports.

Parameters
dThe socket to reuse ports on.
Returns
True if disabling the delaying succeeded, otherwise false.

Definition at line 167 of file os_abstraction.cpp.

Referenced by TCPConnecter::Connect(), and ListenLoopProc().