UDT Reference: UDT Functions

socket

The socket method creates a new UDT socket.

UDTSOCKET socket(
  int af,
  int type = 0,
  int protocol = 0
);

Parameters

af
[in] IP family.
type
[in] Ignored. Type of connection.
protocol
[in] Ignored. Protocol to be used.

Return Values

If no error occurs, socket returns a new UDT socket descriptor; otherwise, it returns UDT::INVALID_SOCK and the specific error information can be retrieved using getlasterror.

Error Code Comment

5003

invalid parameters.

Descriptions

The socket method is used to create a new UDT socket. The last two parameters is only used for compatibility with traditional socket API.

See Also

close