One thing in you code is that in your receive function your are looping over each byte you received and ask to update the widget. What is generally done when handling large amount of data in such small amount is that the processing is done in a different thread. Also the UI update should be batched, there's no real benefit to update your QPlainTextEdit content for every single byte you get.
Hope it helps
Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.