Robert Dober
7/17/2008 2:29:00 PM
On Tue, Jul 15, 2008 at 4:41 PM, Christian Kerth
<christian.kerth@dynamicmedia.at> wrote:
> Hey!
>
> I'm downloading a large number of files via net/http GET Requests using
> 5 Threads.
>
> Each Thread does something like this:
>
> req = Net::HTTP::Get.new(url.path)
> conn = Net::HTTP.new(url.host, url.port)
>
> res = conn.start {
> |http|
> http.request(req)
> }
>
> While the threads are running i sometimes get the Error WSAEADDRINUSE
> 10048 "Address already in use" (i have a German version of Windows XP
> SP2. There the exact message is: Normalerweise darf jede Socketadresse
> (Protokoll, Netzwerkadresse oder Anschluss) nur jeweils einmal verwendet
> werden. - connect(2))
>
> It seems like my code makes Windows run empty on available ports for my
> requests.
>
> Any solutions?
Install Linux ;) -at least we could trace this easily, hopefully some
Window's gurus can help here.
Seriously, this is quite strange, seems as if the client tries to use
an opened port. This however is exactly what clients do not do
normally.
I have never had this error unless I was trying to listen on a port
already used (thus being a server), very often because I started the
same webrick program twice :-O.
Looks almost like a bug to me.
Cann you provide more information like the output of netstat?
R.