• 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
Re: Hanging Sockets
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hanging Sockets


  • Subject: Re: Hanging Sockets
  • From: "Justin C. Walker" <email@hidden>
  • Date: Wed, 5 Jul 2006 14:03:58 -0700


On Jul 5, 2006, at 13:30 , Jaime Magiera wrote:

Hello,

While the topic today seems to be sockets, a question from a newbie network programmer...

While programming with Java (WebObjects and plain vanilla), I've occasionally had crashes that leave the socket hanging. This usually means that I have to reboot the machine to run the application again. In traditional UNIX, there doesn't seem to be a way to reclaim a socket. Is this correct? If so, is there something on the higher Mac OS X level that can do this?

Can you explain what "hanging socket" means? What is your application doing?


Normally, on unix systems, when a program exits, all open file descriptors are closed.

If your program is a server, and you get an "address in use" error when you restart your program, you can work around this, normally by using one or both of the socket options SO_REUSEADDR and SO_REUSEPORT. Their use is described, e.g., in Stevens's Unix Network Programming (see 2nd or 3rd Ed., V1); or you can find some discussions on-line with Google (everyone's best friend).

You really didn't give enough information to be sure of what's going wrong, but I hope this helps.

Regards,

Justin

--
Justin C. Walker, Curmudgeon-At-Large
Institute for the Enhancement of the Director's Income
--------
Experience is what you get
  when you don't get what you want.
--------



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Hanging Sockets
      • From: Jaime Magiera <email@hidden>
References: 
 >Hanging Sockets (From: Jaime Magiera <email@hidden>)

  • Prev by Date: Hanging Sockets
  • Next by Date: Re: Hanging Sockets
  • Previous by thread: Hanging Sockets
  • Next by thread: Re: Hanging Sockets
  • Index(es):
    • Date
    • Thread