PDA

View Full Version : Moving a QTcpSocket around



chaoticbob
1st March 2010, 21:25
Hi guys,

Just wanted to get some opinions on how to do something. I'm working on a server/client app that has three different types of clients. I would like to write three different classes to handle the three different clients types: clientA, clientB, clientC.

So when using QTcpServer and use either incomingConnection or newConnection - what is a good scheme for sending and acknowledgement, asking for the client type, and then moving the ownership of that socket into one of the respective clientA, clientB, clientC?

Thanks.

^NyAw^
2nd March 2010, 10:42
Hi,

Write your own protocol. When the server recives a connection it can write to the socket a query data and the client must return the client type. Then in the server you will know wich kind of client is it.
Of course you can do it in other differtent ways, this is because I said that to you to write your own protocol.

chaoticbob
2nd March 2010, 22:14
Thanks, I'll give his a shot.