IP转换 int型IP与字符型的ip的互换
sockaddr_in m_struSockAddr;
struct sockaddr_in {
short sin_family;
u_short sin_port;
struct in_addr sin_addr;
char sin_zero[8];
};
struct in_addr {
union {
struct { u_char s_b1,s_b2,s_b3,s_b4; } S_un_b;
struct { u_short s_w1,s_w2; } S_un_w;
u_long S_addr;
} S_un;
#define s_addr S_un.S_addr
//将字符型的地址转为整数型
unsigned long inet_addr( const char FAR* cp);
int inet_aton(const char *cp,struct in_addr *inp)
//将整数型IP改为字符串类型
char *inet_ntoa(struct in_addr in)