Net::Socket::Connect Method

Tries to connect to a remote or local host.

Syntax

bool Net::Socket::Connect(
const string&in host,
uint16 port,
uint timeout = Math :: UINT_MAX
)

Parameters

const string&in host
The hostname or IP address to connect to.

uint16 port
The port number to connect to.

uint timeout = Math :: UINT_MAX
The timeout duration for the connection attempt. The timeout is synchronous and will block the game render loop. To avoid this, set this parameter to 0 and check the return value.

Return value

bool
Whether the operation was successful.

Remarks

None.