|
Home > Archive > Unix Programming > August 2005 > rpc with pointer to structs
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
rpc with pointer to structs
|
|
| ofilha 2005-08-17, 5:59 pm |
| I am writing a program that needs to get information about which usb
ports are being used by usb flash drives, but it needs to read this
information from a remote machine as well as the local machine that the
program resides on. I use linked list of structs with the information
and let the user select which port they uant to use.
I am able to get the information on the local machine, but when it
comes to the remote machine, i am running into problems with some of
the data in the struct. When i get the list of structs back some of
the fields are missing part of the data. Secondly, while i am able to
free the linked list on the local machine running as a stand alone,
when i try to use the free function to free the linked list, i am
getting compile errors. Without getting into the code at this time,
does anyone know what is necessary to pass linked lists between
programs using rpc calls ? I looked at some of the examples on Sun,
the OS i am working with, but the example does not really help.
| |
| Fletcher Glenn 2005-08-17, 5:59 pm |
| ofilha wrote:
> I am writing a program that needs to get information about which usb
> ports are being used by usb flash drives, but it needs to read this
> information from a remote machine as well as the local machine that the
> program resides on. I use linked list of structs with the information
> and let the user select which port they uant to use.
> I am able to get the information on the local machine, but when it
> comes to the remote machine, i am running into problems with some of
> the data in the struct. When i get the list of structs back some of
> the fields are missing part of the data. Secondly, while i am able to
> free the linked list on the local machine running as a stand alone,
> when i try to use the free function to free the linked list, i am
> getting compile errors. Without getting into the code at this time,
> does anyone know what is necessary to pass linked lists between
> programs using rpc calls ? I looked at some of the examples on Sun,
> the OS i am working with, but the example does not really help.
>
If you're passing a linked list, then the pointers in this list are
only valid on the source program and not on the destination program.
You would probably have to create your own copies of the list
entries, and then replace the invalid pointers with pointers of
your own.
--
Fletcher Glenn
|
|
|
|
|