You want to a persistent service over a network, one which maintains an on-going connection with its clients.
Create a bi-directional TCP client.
Accessing the Bi-Directional Server:
This particular example initiates contact with the server and starts the conversation in the @connection.on 'connect'@ handler. The bulk of the work in a real client, however, will lie in the @connection.on 'data'@ handler, which processes output from the server. The @ping@ function only recurses in order to illustrate continuous communication with the server and can be removed from a real client.
See also the Bi-Directional Server, Basic Client, and Basic Server recipes.
- Add support for choosing the target domain and port based on command-line arguments or from a configuration file.