qtcpserver

PyQt QTcpServer: How to return data to multiple clients?

寵の児 提交于 2019-12-03 00:40:29
I am looking to create a QTcpServer using PyQt that can simultaneously return data to 2 or more clients. I assume that this will require threading. Using the threadedfortuneserver.py example as a test case (included with PyQt4, on my system it is found in /usr/share/doc/python-qt4-doc/examples/network), I want to connect multiple clients and each time one of the clients asks for a fortune, the other clients also get updated with a message like "Client X just received the fortune 'blah blah blah'". I understand how the fortuneserver/client program works, but it seems that the client connections

Qt, Sending multiple data types from client to server + data Streaming

谁说胖子不能爱 提交于 2019-11-29 08:49:43
I have a Client/Server based Qt application, using QTcpServer and QTcpSocket, I managed to do the connection and send some data back and forth between the client and the server. The client sends many types of data to the server (string, int, files and a real time audio stream) and since my server impliment a single data input SLOT (readyRead()): connect(socket, SIGNAL(readyRead()),this, SLOT(readyRead())); I don't know how could I distinguish between all this received data and call respectively the right function in the server. Example (in the server): - if I receive string => call function

Qt, Sending multiple data types from client to server + data Streaming

只愿长相守 提交于 2019-11-28 02:31:50
问题 I have a Client/Server based Qt application, using QTcpServer and QTcpSocket, I managed to do the connection and send some data back and forth between the client and the server. The client sends many types of data to the server (string, int, files and a real time audio stream) and since my server impliment a single data input SLOT (readyRead()): connect(socket, SIGNAL(readyRead()),this, SLOT(readyRead())); I don't know how could I distinguish between all this received data and call

How to Create a HTTP MJPEG Streaming Server With QTcp-Server Sockets?

时光毁灭记忆、已成空白 提交于 2019-11-27 15:20:39
I want to create a Http Server to send an MJPEG Stream. I'm Already able to send an Image but no Live-Stream. What I did: Created an TCP-Server. When a client Connects a TCP-Socket is created. Then I implemented a ReadyRead SLOT which gots executed when the Browser sends the "GET" Request to the Server. GET / HTTP/1.1 Host: 127.0.0.1:8889 User-Agent: Mozilla/5.0... Then I run following Code QString inbound = m_Client->readAll(); QByteArray header = "HTTP/1.1 200 OK\r\n"; m_Client->write(header); QByteArray ContentType = "Content-Type: image/jpeg\r\n\n"; m_Client->write(ContentType); Mat first