On 7/28/07, Shawn Rutledge <[EMAIL PROTECTED]> wrote:
>
> When I type (exit) into the telnet session, I get errors like this on
> the server side:
>
> Warning (#<thread: thread6>): : port already closed: #<output port (tcp)>
>
>         Call history:
>
>         <eval>          (environment-copy (scheme-report-environment 5) #t)
>         <eval>          (scheme-report-environment 5)
>         <eval>          (environment-extend! env (quote exit) (lambda
> () (close-output-port o) (close-input-port i)))
>         <eval>          (write-line "; dsinpd 0.0.1" o)
>         <eval>          ((letrec ((reploop (##core#loop-lambda () (pp
> (eval (read i) env) o) (reploop)))) reploop))
>         <eval>          (pp (eval (read i) env) o)
>         <eval>          (eval (read i) env)
>         <eval>          (read i)
>         <syntax>                (exit)
>         <eval>          (exit)
>         <eval>          (close-output-port o)
>         <eval>          (close-input-port i)    <--
>
>
> But it is necessary to close both ports, otherwise the client is not
> disconnected.  The example server.scm on the wiki does not act like
> this; so I think it must have to do with the combination of tcp and
> lightweight threads.

The backtrace is misleading: what fails is the "(pp ... o)" on a closed
port (closed by evaluating the "(exit)"). This should actually show up
in the error message. Do you run this test in the interpreter or do you
compile it?


cheers,
felix


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

Reply via email to