creates the server response
cleans the output
implements a simple multi-socket poller