Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    QTcpServer Problem

    General and Desktop
    6
    8
    3330
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mohsen last edited by

      I have a problem with QTcpServer. When i send data from a client to server, it disconnects! but when i send from server to client it works fine!
      i use write() for sending data and readall() to receive data.
      all signals and slots are ok.

      1 Reply Last reply Reply Quote 0
      • A
        andre last edited by

        Without showing the code, there is little we can do for you, I think.

        1 Reply Last reply Reply Quote 0
        • M
          mohsen last edited by

          thanks Andre. i solved the problem by using a bridge class as a thread. i find out that QTCPServer can not separately host tcp connections itself. so i joined another class contained a QTCPSocket object. now i can send and receive data with no problem. also i can have multiple connections to my server now.
          if somebody had the same mean i can place the code here :-)

          1 Reply Last reply Reply Quote 0
          • V
            vestaproman last edited by

            Hello Mohsen,

            I am a newbie in QT and it is exactly what I need, I need multiple connection to a server and the server has to send and receive data. Could you post or send me the code.

            Thanks a lot

            VPM

            1 Reply Last reply Reply Quote 0
            • K
              koahnig last edited by

              @vestaproman

              welcome to the forum

              The post you are replying to is a bit older. So there are chances to have delayed or no replies.

              You may also have a look to the "Network examples":http://qt-project.org/doc/qt-4.8/examples-network.html Especially the fortune "client":http://qt-project.org/doc/qt-4.8/network-fortuneclient.html and http://qt-project.org/doc/qt-4.8/network-fortuneserver.html are quite good for starting.

              Vote the answer(s) that helped you to solve your issue(s)

              1 Reply Last reply Reply Quote 0
              • F
                fuhaijin last edited by

                Hello Andre,
                I have some problem in using QTcpSocket, How to Use QTcpSocket penetrate NAT, Can you give me some advice!
                Thanwandks a lot

                1 Reply Last reply Reply Quote 0
                • F
                  fuhaijin last edited by

                  Hello Andre,
                  I have some problem in using QTcpSocket, How to Use QTcpSocket penetrate NAT, Can you give me some advice!
                  Thanwandks a lot
                  [quote author="Andre" date="1295283294"]Without showing the code, there is little we can do for you, I think.[/quote]

                  1 Reply Last reply Reply Quote 0
                  • B
                    bkerdev last edited by

                    If you solved your problem must be marked [SOLVED]

                    Boris Bker

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post