Re: scsh vs. scheme48 socket

Martin Gasbichler <[email protected]> Thu, 15 Dec 2005 17:08:53 +0100
Newsgroups gmane.lisp.scheme.scsh
Message-ID <[email protected]>
Immanuel Normann <[email protected]> writes:

> from the scheme48 manual I constructed a well working pattern how to 
> communicate with some server over some socket:
>
> (define (ask-server request port-number)
>   (call-with-values
>     (lambda ()
>       (socket-client (get-host-name) port-number))
>     (lambda (in out)
>        (display request out)
>        (close-output-port out)
>        ; some time elapses
>        (let ((answer (read-server-answer in)))
>       (close-input-port in)
>       answer))))
>
>
> Though I can"t find the function "socket-client" in scsh-manual the same 
> pattern works in principle also under scsh. (Fortunately! Otherwise I 
> wouldn"t know at all how to solve my task with the scsh socket functions 
> like: socket-connect, bind-listen-accept-loop, etc.)

The scsh network API is totally independent of the S48 network API and
also more complete than its S48 counterpart.

> However the solution from above works only in principle in scsh (but 
> reliable in scheme48): Whenever the time elapse between the request to 
> and response from the server is to long scsh stucks (read-server-answer 
> is not the problem). Upto now I implemented an unsatisfactory workaround 
> where I force scsh to wait a fix period of time. But of course scsh 
> should only wait as long as necessary.
> Why does scheme48 wait until the answer comes and why does scsh try to 
> pick up the answer immediately?

Could you please post the scsh program as well as the error message
you get?

-- 
Martin