Hi folks,

I'm having an issue with the tcp-connect function. When it fails to connect, it seems not to clean up properly, so that I end up with lots of open ports.

Try this code:

  (require-extension tcp)

  (define (error-info e)
    ((condition-property-accessor 'exn 'message) e))

  (define (test-tcp-connect)
    (condition-case
      (tcp-connect "localhost" 8000)
      (e (exn i/o net) (print (error-info e)))))

assuming there is nothing on port 8000.  Then,

  (let loop ((i 0)) (when (< i 2000) (test-tcp-connect) (loop (+ i 1))))

I get,

  can not create socket - Connection refused
  can not create socket - Connection refused
  ...
  can not create socket - Too many open files
  can not create socket - Too many open files
  ...

I'm using Version 2.731 - linux-unix-gnu-x86. Is this a bug, or is there some way for me to release these ports when I handle the exception?

Thanks!
Matt


_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to