Section Intro: Meta Html Tcp/Ip Servers
Meta Html Tcp/Ip ServersSynopsis:
Meta-HTML provides an extremely convenient path for creating a TCP/IP server which will listen on a particular port, and handle line-based commands.
Typically, an mhc script is used to start the server process -- it
When a connection is received, the server process forks and executes the function that you have specified to run. Upon exit from that function, the connection is closed.
The libraries that are provided in the
The type of server that is implemented by the
The code in
You implement new commands by simply writing a function whose name is
The convenience functions <server::put-line> and <server::get-line> write and read newline terminated lines of text to and from the client respectively.
If you are interested in writing a TCP/IP based server, we would suggest that
you read the source code to the
Kill the server process created with <server::make-server>. This should only be called from within a running server.
Create a server process which will listen on PORT for incoming TCP/IP connections, and return a server indentifier which can be used to crudely control that process.
When a connection is received on that port, the standard streams are
bound to the Meta-HTML variables
A number of variables are bound at connection time. These are:
The META-HTML Reference Manual V2.0 Copyright © 1995, 1998, Brian J. Fox
Found a bug? Send mail to firstname.lastname@example.org