This module implements a socket-based message reading loop.
Usage:serve_socket(Socket,Serve,Handler)
Handles the streams associated to Socket calling Serve on one request of each stream (as Serve(Stream,Unwatch)), and Handler(Stream) if the stream is empty (connection closed). It is expected that Unwatch is unified with yes or no after calls to Serve. If Unwatch=yes then the Stream is removed from the watch list (e.g., useful when the application will perform IO on that stream from a separate thread)
Usage:socket_send_term(Stream,Term)
Writes Term to Stream in a way that it is safe for a socket connection on Stream.