Questions tagged [qtcpsocket]

The QTcpSocket class, part of the Qt framework, provides a TCP socket.

TCP (Transmission Control Protocol) is a reliable, stream-oriented, connection-oriented transport protocol. It is especially well suited for continuous transmission of data.

QTcpSocket is a convenience subclass of QAbstractSocket that allows you to establish a TCP connection and transfer streams of data.

The official Qt documentation can be found here for Qt 4.8 and here for Qt 5.

301 questions
0
votes
1 answer

QTcpSocket doesn't receive all data

Hello everyone i did a server and a client, in loaclHost this programms work perfectly but when i change the localHost to my ip the Client no longer receive all the data, so i decide to rewrite the code. here is a part of my new code: void…
Dan Snow
  • 127
  • 1
  • 11
0
votes
1 answer

TCP network communication security risks

I am developing an application that can establish a server-client connection using QTcp* The client sends the server a number. The received string is checked on its length and quality (is it really a number?) If everything is OK, then the server…
hytromo
  • 1,501
  • 2
  • 27
  • 57
0
votes
1 answer

waitForReadyRead returns empty string - Why isnt it blocking?

I currenlty have a blocking model and the code where my client receives data is as follows QByteArray tick_stream; clntSocket->waitForReadyRead(-1); tick_stream = clntSocket->read(800); Now I believe clntSocket->waitForReadyRead(); should only…
Rajeshwar
  • 11,179
  • 26
  • 86
  • 158
0
votes
1 answer

server response with QTCP Socket

I am connecting my code to an existing server and i am able to get response from the server. But the problem is the content of the response is too large to be handled in a simple way. Right now below is the piece of code that i use it to retrieve…
sankar
  • 347
  • 3
  • 4
  • 15
0
votes
0 answers

Server Response in QTCP SOCKET

I have attached the code I am working on. As you can see I am establishing connection with the server and I am waiting for the response of it. I am executing the command lb which lists me a set of commands. I have successfully established connection…
sankar
  • 347
  • 3
  • 4
  • 15
0
votes
0 answers

QT connection with existing server with username and password

I am working on adapter interface where i connect the simulator which i have constructed with an existing simulator running on a server. I have been going through the QAbstractSocket and I have got some basic idea of it. But the problem is the…
user2591311
  • 31
  • 1
  • 1
  • 5
0
votes
2 answers

Why QTcpSocket received wrong data?

I'm writing a simple network application. Client sending to server message server printing it in QTextEdit and responding to client . I'm using QTcpServer and QTcpSocket. There is a problem I can't solve. Receiving data is quint16 + QTime + QString…
Ilya Glushchenko
  • 317
  • 1
  • 6
  • 13
0
votes
3 answers

Simple TCP communication over Wifi too slow (seconds lag)?

I'm trying to control a robot wirelessly through an Arduino (using a X360 controller on a computer), which requires very low latency. I chose Wifi for this reason (and the fact I'll be streaming video), and after a little test it turns out I have a…
Mister Mystère
  • 952
  • 2
  • 16
  • 39
0
votes
1 answer

How to force QTcpServer listen on a specific port?

Is it possible to force QTcpServer to listen to a specific port smaller than 1024?
Gappa
  • 757
  • 2
  • 16
  • 34
0
votes
2 answers

QTcpSocket: multiple ReadyReads when sending large file

I want to send a 1MB file at 200KB/second (5 second transfer) using a QTcpSocket. The ReadyRead slot function first reads the file size (header), then starts a thread that blocks while reading file_size bytes from the socket. But, since the…
rick
  • 119
  • 1
  • 3
0
votes
1 answer

TCP socket communications are being corrupted

I am trying to use a TCP server and connect to it with a QTcpSocket client. Most of the time, the server and client happen to be on the same machine, but this is not a requirement. What I am trying to do is transfer a file from a running…
jhowland
  • 365
  • 1
  • 5
  • 19
0
votes
2 answers

Strange characters when transferring file with QTcpSocket

I'm trying to transfer a file using a QTcpSocket. The connection runs fine, but my problem is when I try to record the received bytes on a file. When I open the file there are some strange characters at the beginning of the file. What are these…
vanz
  • 319
  • 1
  • 2
  • 12
0
votes
1 answer

QTcpSocket Receiving Data from server

Is it possible to read unknown form of data from a QTcpSocket ? I mean, I have a TCP client and server application. Both are using QDataStream to exchange the data packets successfully. If say any other application (not created be me) sends data…
Anon
  • 173
  • 2
  • 9
0
votes
1 answer

Send QDataStream through QTcpSocket or QSslSocket

I want to send serialized data through ssl or tcp socket. QIODevice::write doesn't send QDataStream but only char* and QByteArray. Is there a way I can send serialized data through socket? Or how can I convert QDataStream to QByteArray? Thanks
Jacob Krieg
  • 2,834
  • 15
  • 68
  • 140
0
votes
1 answer

Qt app crashes on deleting executed task

I have multithread server (inherits QTcpServer). When new connection appears, I create new task (inherits QRunnable), passing socket descriptor to constructor and push this task to QThreadpool (have 3 workers).…
user1627760