• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
A intractable socket bind problem.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A intractable socket bind problem.


  • Subject: A intractable socket bind problem.
  • From: "jacky.zhu" <email@hidden>
  • Date: Mon, 14 Feb 2005 17:07:38 +0800
  • Importance: Normal

Title: Message
hi all,
 
I met an intractable in socket programing.The situation is, I have two processes to run in turn, one opens a socket to listen connections and handles those requests,then it closes the listening socket and notify the other process open another socket on the same IP address and port to continue handling rest connections. The problem is, though I have used the following pieces of code to let sockets could bind to the same address and port:
 
int sockOpt = TRUE;
ret = setsockopt( mListen, SOL_SOCKET, SO_REUSEADDR, (char*)&sockOpt, sizeof(sockOpt) );
 
and the first process has already closed its listening socket, 
 
the second process can't bind its socket to the address and port until about a minute later .
 
It seems a minute or longer time should be consumed to let the system free all handles occupied by the first process even the first process has called close to free its listening socket.
 
Can  any kind people help me resolve it? Any ideaes may be helpful.
 
Thanks,
 
 
Add FUN to your email - CLICK HERE!
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: A intractable socket bind problem.
      • From: Scott Ribe <email@hidden>
    • Re: A intractable socket bind problem.
      • From: John Labovitz <email@hidden>
  • Prev by Date: Re: Storing images in subfolder of apps resource?
  • Next by Date: How to get NSGlyph from unichar?
  • Previous by thread: Re: UDP SOCKETS!!
  • Next by thread: Re: A intractable socket bind problem.
  • Index(es):
    • Date
    • Thread