- lock write message, as it can be called from different threads.
- log the amount of bytes received on the transport.