Skip to content

Latest commit

 

History

History
12 lines (8 loc) · 399 Bytes

16.2_UDP的实现.md

File metadata and controls

12 lines (8 loc) · 399 Bytes

16.2 UDP的实现

另外两个API接口:

ssize_t sendto(int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen);

ssize_t recvfrom(int sockfd, void *buf, size_t len, int flags,struct sockaddr *src_addr, socklen_t *addrlen);
  • dest_addr : 是接收端的IP地址和端口信息;
  • src_addr : 是发送端的IP地址和端口信息;