Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QTcpServer Problem
Qt 6.11 is out! See what's new in the release blog

QTcpServer Problem

Scheduled Pinned Locked Moved General and Desktop
8 Posts 6 Posters 3.9k Views 1 Watching
  • 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 Offline
    M Offline
    mohsen
    wrote on last edited by
    #1

    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
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mohsen
        wrote on last edited by
        #3

        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
        0
        • V Offline
          V Offline
          vestaproman
          wrote on last edited by
          #4

          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
          0
          • K Offline
            K Offline
            koahnig
            wrote on last edited by
            #5

            @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
            0
            • F Offline
              F Offline
              fuhaijin
              wrote on last edited by
              #6

              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
              0
              • F Offline
                F Offline
                fuhaijin
                wrote on last edited by
                #7

                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
                0
                • B Offline
                  B Offline
                  bkerdev
                  wrote on last edited by
                  #8

                  If you solved your problem must be marked [SOLVED]

                  Boris Bker

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved