Add back ability to write to socket
Make copying message to buffer a bit simpler