Phlip (phlip_cpp / yahoo.com) wrote:
[...]
> $ ./radical.rb
> /home/phlip/work/radical-0.25/lib/util/GServer.rb:119:in `new': Address already in use - "bind(2)" (Errno::EADDRINUSE)
[...]

Under certain circumstances, a socket may remain "allocated" for a while
even after the previous process using it has died. You have to use

	setsockopt(socket, Socket::SOL_SOCKET, Socket::SO_REUSEADDR, 1)

beforehand to be able to bind to that port anyway. TCPServer does that
automagically before binding to the port, but if you use raw socket calls
(including Socket.new, I believe), the above will be necessary. (Most of
this is just a guess, but it is the most likely explanation IME -- of
course, it doesn't hurt to check "netstat -a" to see if there is perhaps
an old process still hanging around.)

			Reimer Behrends