
int connect(int s ,
const
struct sockaddr *name ,
int namelen);
The Win32 connect function signature and required header files are:
#include <winsock2.h>
int connect(SOCKET s ,
const
struct sockaddr FAR *name ,
int namelen);
The connect function is used to connect or define the endpoint for a previously cre-
ated socket descriptor. It takes three arguments: the socket descriptor to be operated on,
a sockaddr structure defining the endpoint for the connect operation, and the length of
the sockaddr structure.
The BSD sockets and Winsock versions of the connect function are compatible aside
from return values, as discussed in the “Return Values” section.
Example ...