|
XSocket API
2.0
XIA Socket Library
|
Xconnect() - initiate a connection on a socket. More...
#include "Xsocket.h"Functions | |
| int | Xconnect (int sockfd, const sockaddr *addr, socklen_t addrlen) |
| Initiate a connection on a socket. More... | |
| int Xconnect | ( | int | sockfd, |
| const sockaddr * | addr, | ||
| socklen_t | addrlen | ||
| ) |
The Xconnect() call connects the socket referred to by the sockfd to the address specified by addr.
If sockfd is of type SOCK_DGRAM, then addr is the address to which datagrams are sent by default, and the only address from which datagrams are received.
If the socket is of type SOCK_STREAM this call attempts to make a connection to the socket that is bound to the address specified by addr.
SOCK_STREAM sockets may successfully Xconnect() only once; SOCK_DGRAM sockets may use Xconnect() multiple times to change their association. SOCK_DGRAM sockets may dissolve the association by connecting to an address with the sa_family member of sockaddr set to AF_UNSPEC.
| sockfd | The control socket |
| addr | The address (SID) of the remote service to connect to. |
| addrlen | The length of addr |
1.8.11