mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 00:56:44 +01:00
make binding to an address work SERVER-220
This commit is contained in:
parent
71aa2443a3
commit
7cadc27b27
@ -220,11 +220,12 @@ namespace mongo {
|
||||
addressSize = sizeof(sa);
|
||||
}
|
||||
|
||||
inline SockAddr::SockAddr(const char *ip, int port) {
|
||||
inline SockAddr::SockAddr(const char * iporhost , int port) {
|
||||
string ip = hostbyname( iporhost );
|
||||
memset(sa.sin_zero, 0, sizeof(sa.sin_zero));
|
||||
sa.sin_family = AF_INET;
|
||||
sa.sin_port = htons(port);
|
||||
sa.sin_addr.s_addr = inet_addr(ip);
|
||||
sa.sin_addr.s_addr = inet_addr(ip.c_str());
|
||||
addressSize = sizeof(sa);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user