socket三种地址结构

/* <sys/socket.h> */
struct sockaddr {
    uint8_t sa_len;
    sa_family_t sa_family;
    char sa_data[14];
};
/* <netinet/in.h> */
struct sockaddr_in { uint8_t sin_len; sa_family_t sin_family; in_port_t sin_port; struct in_addr sin_addr; char sin_zero[8]; };/* in_addr_t <--> uint32_t */ struct in_addr { in_addr_t s_addr; };

 

上一篇:socket编程:bind()函数详解


下一篇:2021-04-09