|
Copyright ® (1997-2008) EDMGROUP Pty Ltd - EZY Prolog Reference |
EZY Prolog socket subsystem allows easy way of sending messages to remote server.
Programmer can define special mode, which will force system to send all write statements to the server.
Generally speaking, there is no difference to write to the file (by use of tell/told) or to the opened socket.
To do so, programmer should:
Create connection with remote server using call to socket_create
Define mode to send results of write statement to server socket_tell
Use write(..) statements in usual way
Stop redirection when finished by using call socket_told
As a result, server will receive message in format:
SERVER_MESSAGE = server_stream(TEXT)
where TEXT - is result of write(..) statement on from the client
We included sample program which demonstrates how to use redirection feature of EZY Prolog. Please start client and server under different instances of EZY Prolog and follow instructions.
ezy_socket_server.pro - server part of the sample.
ezy_socket_redirect.pro - client part of the sample.
Program issues write statements on timer events and redirects them to the server.
Copyright © 1997-2008 EDMGROUP (Australia)