mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
Add exclusive mode for windows
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27241 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c4fdb736f6
commit
391b1f6828
2 changed files with 31 additions and 0 deletions
|
@ -130,6 +130,7 @@ GSFunctions.h \
|
|||
GSMime.h \
|
||||
GSXML.h \
|
||||
GSLocale.h \
|
||||
NSTask+GS.h \
|
||||
Unicode.h \
|
||||
GNUstep.h \
|
||||
behavior.h \
|
||||
|
|
|
@ -1680,6 +1680,21 @@ init_ports()
|
|||
sprintf(ebuf, "Opened UDP socket %d", udp_desc);
|
||||
gdomap_log(LOG_DEBUG);
|
||||
}
|
||||
#if defined(__MINGW32__)
|
||||
r = 1;
|
||||
if ((setsockopt(udp_desc,SOL_SOCKET,SO_REUSEADDR,(char*)&r,sizeof(r)))<0)
|
||||
{
|
||||
sprintf(ebuf, "Unable to set 're-use' on UDP socket");
|
||||
gdomap_log(LOG_WARNING);
|
||||
}
|
||||
r = 1;
|
||||
if ((setsockopt
|
||||
(udp_desc,SOL_SOCKET,SO_EXCLUSIVEADDRUSE,(char*)&r,sizeof(r)))<0)
|
||||
{
|
||||
sprintf(ebuf, "Unable to set 'exclusive-use' on UDP socket");
|
||||
gdomap_log(LOG_WARNING);
|
||||
}
|
||||
#endif
|
||||
#ifndef BROKEN_SO_REUSEADDR
|
||||
/*
|
||||
* Under decent systems, SO_REUSEADDR means that the port can be reused
|
||||
|
@ -1773,6 +1788,21 @@ init_ports()
|
|||
sprintf(ebuf, "Opened TDP socket %d", tcp_desc);
|
||||
gdomap_log(LOG_DEBUG);
|
||||
}
|
||||
#if defined(__MINGW32__)
|
||||
r = 1;
|
||||
if ((setsockopt(tcp_desc,SOL_SOCKET,SO_REUSEADDR,(char*)&r,sizeof(r)))<0)
|
||||
{
|
||||
sprintf(ebuf, "Unable to set 're-use' on TCP socket");
|
||||
gdomap_log(LOG_WARNING);
|
||||
}
|
||||
r = 1;
|
||||
if ((setsockopt
|
||||
(tcp_desc,SOL_SOCKET,SO_EXCLUSIVEADDRUSE,(char*)&r,sizeof(r)))<0)
|
||||
{
|
||||
sprintf(ebuf, "Unable to set 'exclusive-use' on TCP socket");
|
||||
gdomap_log(LOG_WARNING);
|
||||
}
|
||||
#endif
|
||||
#ifndef BROKEN_SO_REUSEADDR
|
||||
/*
|
||||
* Under decent systems, SO_REUSEADDR means that the port can be reused
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue