if (line && *line)
{
add_history (line);
- //scm_write (scm_from_locale_string ("("), send_channel);
scm_write (scm_from_locale_string (line), send_channel);
- //scm_write (scm_from_locale_string (")"), send_channel);
scm_force_output (send_channel);
while (scm_char_ready_p (rec_channel) == SCM_BOOL_F) {
if (ctrl_c) break;
- sleep (1);
+ sleep (0.5);
}
if (ctrl_c)
ctrl_c = 0;
scm_c_define ("pipes", pipes);
scm_c_eval_string ("(start-server pipes)");
}
-/*
+
void
start_remote_client (char *hostname, int port)
{
close (sockfd);
}
}
-*/
+
int
main (int argc, char *argv[])
{
else if (mode == 2 && port != 0)
start_server (dirname (argv[0]), port);
else if (mode == 3 && port != 0)
- //start_remote_client (host, port);
- return;
+ start_remote_client (host, port);
else {
fd1 = scm_pipe ();
fd2 = scm_pipe ();
(cond ((eof-object? exp)
(close rec-channel))
(else
- (format #t "Server1: ~a~%" exp)
- (format #t "Server2: ~a~%" (primitive-eval exp))
- (format send-channel "~a" (primitive-eval exp))
- (force-output send-channel)))))
+ (write (format #f "~a" (eval-string exp)) send-channel)))))
(lambda (key . args)
- (format #t "ERROR")
(let ((fmt (string-concatenate (list (cadr args) "~%")))
(params (caddr args)))
- (if params
- (apply format (cons send-channel (cons fmt params)))
- (format send-channel fmt))))))))
+ (write
+ (if params
+ (apply format (cons #f (cons fmt params)))
+ (format #f fmt))
+ send-channel))))
+ (force-output send-channel))))