Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Data Transfer in Socket Programming

Data Transfer in Socket Programming

Scheduled Pinned Locked Moved C / C++ / MFC
sysadminperformancequestion
4 Posts 3 Posters 0 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.
  • G Offline
    G Offline
    georgekjolly
    wrote on last edited by
    #1

    Hai All, I have a doubt regarding the transfer of Data in InterProcess communication like Socket Programming. ->Client and Server are two different Process running in two different machines ->Assume , I am passing a user defined structure from client process to Server Process. ->As usual I will fill the structure with values and pass the address of structure to the server process. ->My doubt starts here , since Server is another process running in another address space and also in another machine, how can the server fetch the values stored in the address given by client. Are they sharing any memory ??, if yes, where it resides ??, Thanks George

    C E 2 Replies Last reply
    0
    • G georgekjolly

      Hai All, I have a doubt regarding the transfer of Data in InterProcess communication like Socket Programming. ->Client and Server are two different Process running in two different machines ->Assume , I am passing a user defined structure from client process to Server Process. ->As usual I will fill the structure with values and pass the address of structure to the server process. ->My doubt starts here , since Server is another process running in another address space and also in another machine, how can the server fetch the values stored in the address given by client. Are they sharing any memory ??, if yes, where it resides ??, Thanks George

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      When you pass a "pointer" to be sent over a communication link (it can be serial port also), you supply also a size. So, what the send function is simply doing is copying X (the size you supplied) bytes starting at the address you supplied (the pointer). So, there is no magic there (or no shared memory or whatever). But, of course you have to take care that what you send is a pure data block (so, if there are pointers in your structure, the address will be sent, with no possibility to extract the data at the other side).


      Cédric Moonen Software developer
      Charting control [v1.2]

      G 1 Reply Last reply
      0
      • G georgekjolly

        Hai All, I have a doubt regarding the transfer of Data in InterProcess communication like Socket Programming. ->Client and Server are two different Process running in two different machines ->Assume , I am passing a user defined structure from client process to Server Process. ->As usual I will fill the structure with values and pass the address of structure to the server process. ->My doubt starts here , since Server is another process running in another address space and also in another machine, how can the server fetch the values stored in the address given by client. Are they sharing any memory ??, if yes, where it resides ??, Thanks George

        E Offline
        E Offline
        Eytukan
        wrote on last edited by
        #3

        georgekjolly wrote:

        ->As usual I will fill the structure with values and pass the address of structure to the server process.

        :confused: What? It's not passing the pointer itself. We just tell the API function from where it should take the structure. We are pointing addresses to the function and NOT!! to the machine that's on the other end! -- modified at 11:53 Thursday 10th May, 2007


        Press: 1500 to 2,200 messages in just 6 days? How's that possible sir? **Dr.Brad :**Well,I just replied to everything Graus did and then argued with Negus for a bit.

        1 Reply Last reply
        0
        • C Cedric Moonen

          When you pass a "pointer" to be sent over a communication link (it can be serial port also), you supply also a size. So, what the send function is simply doing is copying X (the size you supplied) bytes starting at the address you supplied (the pointer). So, there is no magic there (or no shared memory or whatever). But, of course you have to take care that what you send is a pure data block (so, if there are pointers in your structure, the address will be sent, with no possibility to extract the data at the other side).


          Cédric Moonen Software developer
          Charting control [v1.2]

          G Offline
          G Offline
          georgekjolly
          wrote on last edited by
          #4

          Hi Sir, Thank you very much for ur Reply. Thanks and Best Regards George

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups