Results 1 to 4 of 4

Thread: Beginning network programming

  1. #1
    Join Date
    Feb 2006
    Posts
    209
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Beginning network programming

    I have created a simple little game, and I wish to make it play over network. The datatransfer is simple, they take turn sending 4 ints (the moves) to each other.
    How do you write code for this?
    I have never written network code before.

  2. #2
    Join Date
    Feb 2006
    Posts
    209
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Beginning network programming

    Should both clients have a QTcpServer running and let the other client connect to them? Or should only one be runnig as server?

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Beginning network programming

    It doesn't matter. For simplicity make only one of them a server.

  4. #4
    Join Date
    Feb 2006
    Posts
    209
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Beginning network programming

    I'm trying to work with the
    http://doc.trolltech.com/4.3/network-fortuneclient.html

    example, but how can I let the client send data back to the server?

    Update: I think I got it! I just send back data and receive it with the socket that was given by the nextPending-something .
    It worked!
    Last edited by Morea; 29th May 2007 at 20:34.

Similar Threads

  1. Qt Network Programming
    By Walsi in forum Qt Programming
    Replies: 5
    Last Post: 25th May 2007, 10:50
  2. Network programming and the main thread
    By invictus in forum Qt Programming
    Replies: 5
    Last Post: 16th March 2007, 00:25

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.