Results 1 to 3 of 3

Thread: Moving a QTcpSocket around

  1. #1
    Join Date
    Oct 2008
    Posts
    37
    Thanked 2 Times in 2 Posts

    Default Moving a QTcpSocket around

    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.

  2. #2
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Moving a QTcpSocket around

    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.
    Òscar Llarch i Galán

  3. #3
    Join Date
    Oct 2008
    Posts
    37
    Thanked 2 Times in 2 Posts

    Default Re: Moving a QTcpSocket around

    Thanks, I'll give his a shot.

Similar Threads

  1. Moving QPixmap
    By Revengeog in forum Qt Programming
    Replies: 1
    Last Post: 1st October 2009, 11:57
  2. moving QTreeWidgetItem
    By ^NyAw^ in forum Qt Programming
    Replies: 3
    Last Post: 3rd July 2009, 20:17
  3. moving in opengl
    By sdastagirmca in forum Qt Programming
    Replies: 2
    Last Post: 13th June 2009, 12:21
  4. Moving a QFile
    By stevey in forum Qt Programming
    Replies: 1
    Last Post: 24th August 2006, 11:56
  5. [Qt4] - Moving Widget...
    By IPFreely in forum Qt Programming
    Replies: 1
    Last Post: 13th June 2006, 09:32

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.