Trying to be more robust about error handling and failure.
- limit on number of tcp connections - preliminary support for websockets