scsh-users
[Top] [All Lists]

Re: scsh vs. scheme48 socket

To: Immanuel Normann <i.normann@iu-bremen.de>
Subject: Re: scsh vs. scheme48 socket
From: Martin Gasbichler <gasbichl@informatik.uni-tuebingen.de>
Date: Thu, 15 Dec 2005 17:08:53 +0100
Cc: scsh-users@scsh.net
List-id: <scsh-users.list-id.scsh.net>
Immanuel Normann <i.normann@iu-bremen.de> 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

<Prev in Thread] Current Thread [Next in Thread>