UDT Reference: UDT Functions

connect

The connect method connects to a server UDT entity and constructs a UDT connection.

int connect(
  UDTSOCKET u,

  const struct sockaddr *name,

  int namelen
);

Parameters

u
[in] Descriptor identifying an unconnected socket.
name
[in] Name of the socket to which the connection should be established.
namelen
[in] Length of the name.

Return Values

On success, 0 is returned. Otherwise, UDT::ERROR is returned and the specific error information can be retrieved using getlasterror.

Error Code Comment

1001

server does not exist.

1002

the connection request is rejected by the server.

1004

connection request was aborted due to security reasons.

5002

the socket is not allowed to do a connect call: it is either in listening state or has been already connected.

5004

u is an invalid UDT socket.

5008

The rendezvous set up processing is enabled; bind should be called before connect.

Description

The connect method tries to connect to the UDT server at name. Since UDT is connection-oriented, the connection set up process will need at least 1 round trip time to finish.

The blocking manner does not affect the connect call. The connect process is always blocked until the connection is set up or rejected.

See Also

bind, listen