Don't forget to read QAbstractSocket documentation and learn about blocking and nonblocking socket.