Five examples have been provided in IPC/TCP/demo
. Each example has
detailed instructions on its use in its source file. A Makefile is provided
in the demo
directory.
Calling absolute_file_name/2
is a convenient way of finding the
path to a demonstration program. For example, to find the sibling
demonstration, try issuing the command
| ?- absolute_file_name(demo('sibling.pl'),X).
Here is a list of the example tcp programs.
client.pl, server.pl
sibling.pl
tcp_watch_user/2
predicate.
ce.pl
cs.c
server.pl
from the c-shell. If the ServerFile (see tcp_address_from_file/2
,
ipc-tcp-mco-address_from_file2) for some server is x
, then
% cs x "write('hi there'),nl"
causes the server to write the string "hi there\n"
to its socket. The C
program cs.c
copies the socket output from the server to stdout
.
c_server.c, c_server.pl