manpagez: man pages & more
info guile
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.17.12 REPL Servers

The procedures in this section are provided by

(use-modules (system repl server))

When an application is written in Guile, it is often convenient to allow the user to be able to interact with it by evaluating Scheme expressions in a REPL.

The procedures of this module allow you to spawn a REPL server, which permits interaction over a local or TCP connection. Guile itself uses them internally to implement the ‘--listen’ switch, Command-line Options.

Scheme Procedure: make-tcp-server-socket [#:host=#f] [#:addr] [#:port=37146]

Return a stream socket bound to a given address addr and port number port. If the host is given, and addr is not, then the host string is converted to an address. If neither is given, we use the loopback address.

Scheme Procedure: make-unix-domain-server-socket [#:path="/tmp/guile-socket"]

Return a UNIX domain socket, bound to a given path.

Scheme Procedure: run-server [server-socket]
Scheme Procedure: spawn-server [server-socket]

Create and run a REPL, making it available over the given server-socket. If server-socket is not provided, it defaults to the socket created by calling make-tcp-server-socket with no arguments.

run-server runs the server in the current thread, whereas spawn-server runs the server in a new thread.

Scheme Procedure: stop-server-and-clients!

Closes the connection on all running server sockets.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on April 20, 2013 using texi2html 5.0.

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.