Hi Alex & Rowan,

As far as I can see, there is no other process listening on 8080 at the moment when I get this "Address already in use". However, I've just managed to put together a tiny Ruby server (found something on stackoverflow) that works. It uses "server = TCPServer.open(host, port)" where 'host' is "127.6.26.129" and 'port' is 8080. Right now it's available here <http://demo-project.jkleiser.c9.io/>, but not for very long ...
When I do the "lsof -i :8080" now, I get this:

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME ruby 16690 517cfc775004464968000196 5u IPv4 21717622 0t0 TCP 127.6.26.129:webcache (LISTEN)

/Jon

On 16-05-13 15:34 , Alexander Burger wrote:
Hi Rowan,

Just throwing in an observation in case it hasn't already occurred
to you - the "Address already in use" error might well not be a picolisp
or C9 problem at all, but that you are reconnecting to the socket
without having set the SO_REUSEADDR option (or equivalent). Without it
you can't reconnect to an already connected socket, e.g. for about 90
seconds on Linux, or similar duration on other platforms (must wait
That's right. But in this case the function in question ('port') does
indeed set this option.


However, it still might be the case that some other service is already
listening at that port, perhaps even some not-yet-terminated instance of
your application.

You can find out the culprit with

    $ lsof -i :8080
    COMMAND    PID USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
    picolisp 20278  app   16u  IPv6 2098603      0t0  TCP *:http-alt (LISTEN)

♪♫ Alex

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to