Results 1 to 3 of 3

Thread: Is there common practice on how to handle Socket data in socket programming?

  1. #1
    Join Date
    Jul 2012
    Posts
    201
    Thanks
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Is there common practice on how to handle Socket data in socket programming?

    Hi there guys, I am writing this Client-Server software where the server must authenticate the user. The username and pwd is sent to the server through a QTcpSocket, ofcourse this data is sent in form of a QByteArray. My problem is separating the username and pwd on the server side so that the server can authenticate. I have a bunch of ideas on on how I can do this but I was wondering if there is common practice on how this is done. After authenticating the user there is a lot of back and font communication between the client and the server, is there also common practice on how socket data is handled?

    Thanking you in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Is there common practice on how to handle Socket data in socket programming?

    I have a bunch of ideas on on how I can do this but I was wondering if there is common practice on how this is done.
    Usually its done via serialization.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Is there common practice on how to handle Socket data in socket programming?

    Usually its done via serialization.
    For example, by a formal protocol such as SOAP, or by an informal protocol you invent yourself which is understood by both your client and your server.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. QT Socket programming
    By praveen1 in forum Newbie
    Replies: 2
    Last Post: 7th September 2012, 09:28
  2. TQ Socket Programming
    By praveen1 in forum Newbie
    Replies: 1
    Last Post: 24th August 2012, 10:24
  3. Socket programming
    By isharasjc in forum General Discussion
    Replies: 5
    Last Post: 21st March 2012, 09:03
  4. socket programming
    By Arpitgarg in forum Newbie
    Replies: 13
    Last Post: 21st April 2011, 09:25
  5. Can any One help me? - Socket Programming?
    By vinod in forum Qt Programming
    Replies: 6
    Last Post: 18th November 2009, 09:46

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.