network: display correct host/port in debug info
network: clear buffer after a message is received

This ensures that shorter payloads does not end with data from previous
(and longer) messages.