scsh-users
[Top] [All Lists]

scsh vs. scheme48 socket

To: scsh-users@scsh.net
Subject: scsh vs. scheme48 socket
From: Immanuel Normann <i.normann@iu-bremen.de>
Date: Thu, 15 Dec 2005 16:59:52 +0100 (MET)
List-id: <scsh-users.list-id.scsh.net>
Hello,

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.)

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?

Immanuel

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