In order to learn some basics about sockets I'm trying to program a simple IRC client. In order to receive server messages I have a thread that is receiving from the socket. When sending commands to the server a new thread is created, with the same socket. This doesn't seem to work. The commands are executed, but do not seem to be sent through the socket (nothing happens).
So, my question is this. Is this approach, with threads and a socket, impossible to realise? An IRC client needs to have only one persistent connection, right? Can I get any feedback from the socket.send, when sending commands, to get a clue of whats happening? I'm attaching the present code if anyone wants to see it.