Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. How to form a client/server setup using Qt?
Forum Updated to NodeBB v4.3 + New Features

How to form a client/server setup using Qt?

Scheduled Pinned Locked Moved Qt Creator and other tools
9 Posts 6 Posters 5.7k 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.
  • S Offline
    S Offline
    shahthehitman
    wrote on last edited by
    #1

    i have connected two PC's using LAN (both are running on RHEL OS). How does one transfer data , access files, run them etc in the other PC from a particular PC "using Qt" ???

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DenisKormalev
      wrote on last edited by
      #2

      What do you mean by "access files, run them"?
      You need to create both client and server apps (or use ssh as server one) and implement all needed functionality there. QTcpSocket (or QUdpSocket) will help you.

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jim_kaiser
        wrote on last edited by
        #3

        I'm not sure, if this is what you want.. but to transfer data, you need to run a Qt application on both pc's, one acting as the server, other as the client. Then you could use Qt's TCP classes maybe to make a connection to the ip, port and transfer data. You could also have a dual connection, each is both server and client, depending on your need. If you need to transfer a lot of data, you could use the QFtp class. But you need to be running the ftp server on the host (but that's trivial in Linux anyway). And why do you want to use Qt to transfer files? Automation? Backups?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          shahthehitman
          wrote on last edited by
          #4

          @ Denis - wat i meant was ... i need to access the PC remotely and be able to run .exe files on that PC remotely !

          Which function used to define IP address in Qt?

          1 Reply Last reply
          0
          • K Offline
            K Offline
            koahnig
            wrote on last edited by
            #5

            you may use "this ":http://doc.qt.nokia.com/4.7/qhostaddress.html to define an IP address in Qt.
            Here you find the details "QtTcpServer":http://doc.qt.nokia.com/4.7/qtcpserver.html

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

            1 Reply Last reply
            0
            • J Offline
              J Offline
              jim_kaiser
              wrote on last edited by
              #6

              So, what you need to to implement a server and client, define your protocol, and make the calls needed. Suppose, you want to run myexe.exe on the remote machine, you would send an XML request maybe like <request_run executable="myexe.exe"/>. Which would then be parsed on the remote machine by your application and can run the executable. Now, you can then send some response back too in a similar fashion. If you want to get the visual output of the execution like Remote Desktop... thats not gonna be easy. Anyways, read about RPC (Remote Procedure Call) and the Qt classes QTcpServer and QTcpSocket.

              1 Reply Last reply
              0
              • A Offline
                A Offline
                andre
                wrote on last edited by
                #7

                Why do you want to use Qt for that? To me, it sounds like you need a ready-made solution.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  shahthehitman
                  wrote on last edited by
                  #8

                  @ Andre ..My final product should be that i should
                  "click a button" on say PC1 which should run a executable on PC2 in a LAN !

                  Now how do i do that ?

                  1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    goetz
                    wrote on last edited by
                    #9

                    Create an application on PC2 which listens on some TCP socket. It receives "commands" from PC1 and reacts on those. It's up to you to invent a suitable protocol.

                    http://www.catb.org/~esr/faqs/smart-questions.html

                    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