mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
socket fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39919 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ecfbd24d8e
commit
01377d55ee
3 changed files with 21 additions and 20 deletions
|
@ -1503,9 +1503,6 @@ typedef struct {
|
|||
NSMapEnumerator me;
|
||||
int sock;
|
||||
void *dummy;
|
||||
#ifndef BROKEN_SO_REUSEADDR
|
||||
int opt = 1;
|
||||
#endif
|
||||
GSMessageHandle *handle = nil;
|
||||
|
||||
M_LOCK(myLock);
|
||||
|
@ -1533,20 +1530,6 @@ typedef struct {
|
|||
{
|
||||
NSLog(@"unable to create socket - %@", [NSError _last]);
|
||||
}
|
||||
#ifndef BROKEN_SO_REUSEADDR
|
||||
/*
|
||||
* Under decent systems, SO_REUSEADDR means that the port can be reused
|
||||
* immediately that this process exits. Under some it means
|
||||
* that multiple processes can serve the same port simultaneously.
|
||||
* We don't want that broken behavior!
|
||||
*/
|
||||
else if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char*)&opt,
|
||||
sizeof(opt)) < 0)
|
||||
{
|
||||
(void)close(sock);
|
||||
NSLog(@"unable to set reuse on socket - %@", [NSError _last]);
|
||||
}
|
||||
#endif
|
||||
else if ((handle = [GSMessageHandle handleWithDescriptor: sock]) == nil)
|
||||
{
|
||||
(void)close(sock);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue