Monday, 14 January 2013

send() and recv() - Let's talk!


send() and recv() - Let's talk!

● The two functions are for communicating over
stream sockets or connected datagram sockets.
● int send(int sockfd, const void *msg, int len, int
flags);
– sockfd is the socket descriptor you want to send data to
(returned by socket() or got from accept())
– msg is a pointer to the data you want to send
– len is the length of that data in bytes
– set flags to 0 for now
– sent() returns the number of bytes actually sent (may
be less than the number you told it to send) or -1 on
error

No comments:

Post a Comment