Your loop doesn't make any sense. connectToHost() is a non-blocking call, it just schedules a connect and returns immediately. You need a timer that is started when the socket manages to connect and that triggers a slot that will write to the socket. Oh, and if you expect that you'll get the data on the receiving end with time differences of 20ms, that's probably not going to happen. I would expect to see it all coming at the same time (or almost at the same time) unless you send enough data to fill one TCP window each time.