Fixed EOF while reading from socket
Moved receiving and sending messages to their own threads