Socket

Namespace: dmSocket Language: C++ Type: Defold C++ File: socket.h Source: engine/dlib/src/dmsdk/dlib/socket.h Include: dmsdk/dlib/socket.h

Socket functions.

API

Address

Type: STRUCT Network addresses were previously represented as an uint32_t, but in order to support IPv6 the internal representation was changed to a struct.

Connect

Type: FUNCTION Initiate a connection on a socket

Parameters

Returns

Delete

Type: FUNCTION Delete a socket. Corresponds to BSD socket function close()

Parameters

Returns

Domain

Type: ENUM Domain type

Members

GetFD

Type: FUNCTION Get underlying file descriptor

Parameters

Returns

GetHostByName

Type: FUNCTION Get host by name

Parameters

Returns

GetHostByName

Type: FUNCTION Get host by name with timeout and cancelability

Notes

Parameters

Returns

INVALID_SOCKET_HANDLE

Type: CONSTANT Invalid socket handle

New

Type: FUNCTION Create a new socket. Corresponds to BSD socket function socket().

Notes

Parameters

Returns

Protocol

Type: ENUM Network protocol

Members

Receive

Type: FUNCTION Receive data on a socket

Notes

Parameters

Returns

Result

Type: ENUM Socket result

Members

ResultToString

Type: FUNCTION Convert result value to string

Parameters

Returns

Select

Type: FUNCTION Select for pending data

Parameters

Returns

Selector

Type: STRUCT Selector

SelectorClear

Type: FUNCTION Clear selector for socket. Similar to FD_CLR

Parameters

Returns

SelectorIsSet

Type: FUNCTION Check if selector is set. Similar to FD_ISSET

Parameters

Returns

SelectorKind

Type: ENUM Selector kind

Members

SelectorSet

Type: FUNCTION Set selector for socket. Similar to FD_SET

Parameters

Returns

SelectorZero

Type: FUNCTION Clear selector (all kinds). Similar to FD_ZERO

Parameters

Returns

Send

Type: FUNCTION Send a message on a socket

Notes

Parameters

Returns

SetBlocking

Type: FUNCTION Set blocking option on a socket

Parameters

Returns

SetBroadcast

Type: FUNCTION Set broadcast address option on socket. Socket option SO_BROADCAST on most platforms.

Parameters

Returns

SetNoDelay

Type: FUNCTION Set TCP_NODELAY on socket

Parameters

Returns

SetQuickAck

Type: FUNCTION Set TCP_QUICKACK on socket

Notes

Parameters

Returns

SetReceiveTimeout

Type: FUNCTION Set socket receive timeout

Notes

Parameters

Returns

SetReuseAddress

Type: FUNCTION Set reuse socket address option on socket. Socket option SO_REUSEADDR on most platforms

Parameters

Returns

SetSendTimeout

Type: FUNCTION Set socket send timeout

Notes

Parameters

Returns

Shutdown

Type: FUNCTION Shutdown part of a socket connection

Parameters

Returns

ShutdownType

Type: ENUM Socket shutdown type

Members

Socket

Type: TYPEDEF Socket type definition

Notes

SOCKET_TIMEOUT

Type: CONSTANT Socket default timeout value

Type

Type: ENUM Socket type

Members