Re: Hanging Sockets
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