A very simple high-level JSON-based messaging socket server and client.
var port = 9000;var server = replier;
var client = replier;// the result is 6
Checks if there's already a server listening to the given
Booleantrue, if the server is alive.
Creates and returns a replier server object which is an instance of
The code above is relevant to:
Listens to a port.
Emitted when the server has reseived a message from the client.
Differs from normal events, this event passes a function
reply parameter which is used to reply responses to the client.
responsewill be passed to the
Emitted when the server has been bound after calling server.listen.
Emitted when the server closes. Note that if connections exist, this event is not emitted until all connections are ended.
Emitted when an error occurs. The 'close' event will be called directly following this event. See example in discussion of server.listen.
ObjectThe options of
Error Objectserver error, see The GNU C Library - Error Reporting for details
Connects the client to the server.
ObjectThe data to be sent to the server
mixederror information from the server
Sends messages to the server, and
Close the client.