cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Issue with SO_REUSEADDR in bindlocal

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Sat, 19 Mar 2005 17:03:29 +0100 (CET)

On Sat, 19 Mar 2005, Rhys Feingold wrote:

> However, then I run up against the bind failure during TIME_WAIT problem,
> and so I call setsockopt with SO_REUSEADDR just before the call to bind() in
> bindlocal. This does not seem to work. Any pointers ?

I don't think there is an easy fix or work-around. TIME_WAIT is there for a
reason.

I would recommend that you make the code allow a port range, so that it can
try another port when this happens. And you need to make your code deal with
this (address already in use) failure and retry later.

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2005-03-19