diff options
| author | Artyom Poptsov <poptsov.artyom@gmail.com> | 2014-01-04 22:24:14 +0400 |
|---|---|---|
| committer | Artyom Poptsov <poptsov.artyom@gmail.com> | 2014-01-04 22:24:14 +0400 |
| commit | 1ad809c01d95429c495a8acc3754a6118a932b1f (patch) | |
| tree | 1de68e1a686621147d05b8de9d6d836d1afc5755 /examples/echo | |
| parent | src/channel-type.c (ptob_close): New procedure. (diff) | |
| download | guile-ssh-1ad809c01d95429c495a8acc3754a6118a932b1f.tar.gz | |
src/channel-type.c (ptob_input_waiting): Implement the procedure.
* src/channel-type.c (ptob_input_waiting): Call `ssh_channel_poll'.
(init_channel_type): Register callback with
`scm_set_port_input_waiting' procedure.
* examples/echo/server.scm (main): Use `char-ready?' predicate
instead of the custom procedure `channel-poll'.
Diffstat (limited to 'examples/echo')
| -rwxr-xr-x | examples/echo/server.scm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/echo/server.scm b/examples/echo/server.scm index b13675a..8aa07b7 100755 --- a/examples/echo/server.scm +++ b/examples/echo/server.scm @@ -120,13 +120,13 @@ ((request-channel-open) (set! channel (handle-req-channel-open msg msg-type)) - (let poll ((count #f)) - (if (or (not count) (zero? count)) - (poll (channel-poll channel #f)) + (let poll ((ready? #f)) + (if ready? (let ((str (read-line channel))) (format #t "Received message: ~a~%" str) (display "Echoing back...\n") - (display str channel)))) + (display str channel)) + (poll (char-ready? channel)))) (close channel)) ((request-channel) |
