Monday, 14 January 2013

sendto() and recvfrom() - DGRAM style


sendto() and recvfrom() - DGRAM
style

● int sendto(int sockfd, const void *msg, int len, int
flags, const struct sockaddr *to, int tolen);
– to is a pointer to a struct sockaddr which contains the
destination IP and port
– tolen is sizeof(struct sockaddr)
● int recvfrom(int sockfd, void *buf, int len, int flags,
struct sockaddr *from, int *fromlen);
– from is a pointer to a local struct sockaddr that will be
filled with IP address and port of the originating
machine
– fromlen will contain length of address stored in from

No comments:

Post a Comment