Zelphir Kaltstahl 2214aa59be add some description 5 سال پیش
..
networking-lib aa17422275 implemented "protocols" and json echo server/client 6 سال پیش
dependencies.md 24d4ff51d1 made server usable from outside the module 6 سال پیش
official-guile-guide-examples.scm 839f0cd88a remove not needed load path specifications 5 سال پیش
readme.org 2214aa59be add some description 5 سال پیش
run-client.scm 839f0cd88a remove not needed load path specifications 5 سال پیش
run-server.scm 839f0cd88a remove not needed load path specifications 5 سال پیش
tcp-client.scm 839f0cd88a remove not needed load path specifications 5 سال پیش
tcp-server.scm 839f0cd88a remove not needed load path specifications 5 سال پیش

readme.org

About

This example presents a way to use Guile to build a naive TCP client and TCP server.

Documentation

One idea in this example implementation is, that you can define a protocol for the server and for the client separately, by specifying ...

  1. port reader
  2. message handler
  3. end of file handler

... for each end.

The example defines a JSON display protocol, which simply displays any JSON received from the server and a JSON echo protocol for the server, which simply sends back whatever the server receives.

For a real application one can imagine all kind of things to be invoked from the handlers, which constitute a protocol.

This example does not deal with any complex logic implemented in the handlers.