Menu

How to perform a callback

Help
2008-11-12
2013-04-24
  • Awais Abbasi

    Awais Abbasi - 2008-11-12

    I am trying to access a function on a server, that function that has 2 parameters
    first the the function name that server should callback on client
    and other is client IP i.e 10.0.4.33:4542

    what do i have to do on client side so that server calls a method on my client.
    I have no control over server, it up there providing it services

     
    • Piotrek

      Piotrek - 2008-11-12

      To the best of my understanding, you have to have two sets of server-client pairs to do what you're trying to do.
      Setup:
      - Client 1 and Server 2 are on machine X
      - Server 1 and Client 2 are on machine Y

      Client 1 sends request to Server 1.
      Server 1 calls object.function() which is part of Client 2 --> that means Client 2 issues a call to Server 2

      X ----Client1 ---> Server1 ---Y
                                                 |
                                                 |
      X  ----Server2 <----Client2  -Y

      Hope this helps...
      Pete

       
      • Piotrek

        Piotrek - 2008-11-12

        Just to clarify the ASCII pic -- the two vertical lines should NOT be connecting X, they SHOULD be connecting Y.

         
    • Awais Abbasi

      Awais Abbasi - 2008-11-12

      thanks for such a quick response
      i will try it out
      again thanks alot

       
    • Awais Abbasi

      Awais Abbasi - 2008-11-12

      yeah i forgot to mention that i have no control over the server i cannot change it
      what are my options than

       
    • Awais Abbasi

      Awais Abbasi - 2008-11-12

      if function on server is taking function name(running at client) as an argument, thn this means server should have a way of calling that method.
      Now the question is, the only solution possible is the way you have recommended ?
      or there could be other ways also

       
      • Piotrek

        Piotrek - 2008-11-12

        The server's only job is to listen for incoming requests and execute callbacks.
        If you can register a callback that goes out and does something over the network, then that's your answer.
        Good luck!
        Pete

         
    • Awais Abbasi

      Awais Abbasi - 2008-11-14

      thanks

       
    • Awais Abbasi

      Awais Abbasi - 2008-11-19

      sorry for bugging you again
      but I dont know much about C++ so I am a newbie

      can you provide a sample code that how can i register a callback
      Thanks

       
    • Awais Abbasi

      Awais Abbasi - 2008-11-27

      psipika you were right

      i had to make server at client's end and it did work
      thanks

      if anybody needs help he/she can contact me or I i will post sample code later
      go to run

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.