int send(int sockfd, const void *msg, int len, int flags);
Parameters
sockfd is the socket descriptor you want to send data to (whether it’s the one returned by socket() or the one you got with accept())
msg is the message
len is the length of the message
flags can again be set to 0
return values
send() returns the number of bytes actually sent out
-1 is returned on error, and errno is set to the error number.
example
char *msg = "Beej was here!";
int len, bytes_sent;
.
.
.
len = strlen(msg);
bytes_sent = send(sockfd, msg, len, 0);
.
.
.