Discussion:
TCP server ports
Peter
2017-09-14 09:28:14 UTC
Permalink
Hello!

Is there a kawa-specific way to open a server tcp port, listen for
clients, and get back a normal Scheme I/O port when someone connects?

Thanks for any help with this!
Greetings, Peter
Per Bothner
2017-09-14 17:18:19 UTC
Permalink
Post by Peter
Hello!
Is there a kawa-specific way to open a server tcp port, listen for
clients, and get back a normal Scheme I/O port when someone connects?
Thanks for any help with this!
Not that I know of. But you can use standard Java class and methods
directly in Kawa-Scheme.

(define socket (listen-for-socket)) ; make your own listen-for-socket
(define inp (gnu.kawa.io.InPort (socket:getInputStream)))

BTW if you write
socket:input-stream
Kawa will automatically treat it like
(socket:getInputStream)
--
--Per Bothner
***@bothner.com http://per.bothner.com/
Loading...