mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-15 14:22:57 -06:00
git-svn-id: svn://ultimatepp.org/upp/trunk@407 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
ac7787c74c
commit
3519eb154f
1 changed files with 7 additions and 1 deletions
|
|
@ -161,6 +161,12 @@ bool Socket::Data::OpenServer(int port, bool nodelay, int listen_count, bool blo
|
|||
return true;
|
||||
}
|
||||
|
||||
Mutex& GetHostByNameMutex()
|
||||
{
|
||||
static StaticCriticalSection m;
|
||||
return m;
|
||||
}
|
||||
|
||||
bool Socket::Data::OpenClient(const char *host, int port, bool nodelay, dword *my_addr, int timeout, bool block)
|
||||
{
|
||||
SLOG("Socket::Data::OpenClient(" << host << ':' << port << ", timeout " << timeout << ", block " << block << ')');
|
||||
|
|
@ -171,7 +177,7 @@ bool Socket::Data::OpenClient(const char *host, int port, bool nodelay, dword *m
|
|||
sockaddr_in addr;
|
||||
|
||||
{
|
||||
CriticalSection::Lock __(host_lock);
|
||||
CriticalSection::Lock __(GetHostByNameMutex());
|
||||
Socket::Init();
|
||||
hostent *he = gethostbyname(host);
|
||||
if(!he) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue