|
| From: | Matt Jones |
| Subject: | Re: [Chicken-users] tcp-connect open ports problem |
| Date: | Mon, 06 Apr 2009 01:57:22 +0100 |
| User-agent: | Thunderbird 1.5.0.14pre (X11/20071022) |
felix winkelmann wrote:
On Mon, Apr 6, 2009 at 1:22 AM, Matt Jones <address@hidden> wrote:(BTW, this part of my message aboveThe function 'fail appears to close the port -- (##net#close s) -- but somehow these ports end up open and accumulate.refers to the code in Chicken's tcp.scm, in the definition of tcp-connect, not my code. My code isn't trying to close the port. My point there was that tcp-connect appears to close the port before signalling an exception, yet the port remains open. I realize that was probably unclear.)Yes, I was talking about the chicken code. It's a bug and we'll fix it, but we have to figure out first what exactly is happening. cheers, felix
Ah, I found the problem. My first analysis was wrong. In fact, after line 609 in tcp.scm in the version 3.4 source, the port isn't closed before signalling the exception:
(let ((err (get-socket-error s)))
(cond ((= err -1)
; Not closed here
...)
((> err 0)
; Not closed here
...)))
Just adding the line (##net#close s) fixes the problem.
Good job on the version 4 release!
Best
Matt
| [Prev in Thread] | Current Thread | [Next in Thread] |