|
Connecting to a Server with TCP
NAME
connect - initiate a connection on a socket
SYNOPSIS
#include <sys/types.h>
#include <sys/socket.h>
int connect(int s, struct sockaddr
*serv_addr, int addrlen );
RETURN VALUE
If the connection or binding succeeds, zero is returned.
On error, -1 is returned, and errno is set appropriately.
We will use a sockaddr_in structure (possibly cast)
After connect, s is available to read/write
|