sockaddr_in Struct Reference

#include <stdapis/netinet/in.h>

struct sockaddr_in
Public Attributes
struct in_addrsin_addr
u_shortsin_family
u_shortsin_port
charsin_zero

Detailed Description

Socket address, internet style.

Member Attribute Documentation

sin_addr

struct in_addrsin_addr

IP address.

sin_family

u_shortsin_family

AF_INET.

sin_port

u_shortsin_port

Port number. .

sin_zero

charsin_zero

There's also this sin_zero field which some people claim must be set to zero. Other people don't claim anything about it (the Linux documentation doesn't even mention it at all), and setting it to zero doesn't seem to be actually necessary. So, if you feel like it, set it to zero using memset().