Currently, the message parsing and handling in the PWP is intertwined. This should be refactored into a Connection class, which should handle reading from the TCP stream and parsing messages.
This should expose pop/push methods for receiving/sending messages
Pop should use a message queue internally, which gets populated as soon as a full message can be parsed.
The class should handle timeouts/any sharp edges with TCP.
Currently, the message parsing and handling in the PWP is intertwined. This should be refactored into a Connection class, which should handle reading from the TCP stream and parsing messages.