CHECK_ADDRESS(address, INET, GSOCK_INVADDR);
- address->m_host = hostaddr ;
+ address->m_host = htonl(hostaddr) ;
return GSOCK_NOERROR;
}
assert(address != NULL);
CHECK_ADDRESS(address, INET, 0);
- return address->m_host;
+ return ntohl(address->m_host);
}
unsigned short GAddress_INET_GetPort(GAddress *address)
CHECK_ADDRESS(address, INET);
addr = &(((struct sockaddr_in *)address->m_addr)->sin_addr);
- addr->s_addr = hostaddr;
+ addr->s_addr = htonl(hostaddr);;
return GSOCK_NOERROR;
}
addr = (struct sockaddr_in *)address->m_addr;
- return addr->sin_addr.s_addr;
+ return ntohl(addr->sin_addr.s_addr);
}
unsigned short GAddress_INET_GetPort(GAddress *address)
CHECK_ADDRESS(address, INET);
addr = &(((struct sockaddr_in *)address->m_addr)->sin_addr);
- addr->s_addr = hostaddr;
+ addr->s_addr = htonl(hostaddr);
return GSOCK_NOERROR;
}
addr = (struct sockaddr_in *)address->m_addr;
- return addr->sin_addr.s_addr;
+ return ntohl(addr->sin_addr.s_addr);
}
unsigned short GAddress_INET_GetPort(GAddress *address)