0

I'm trying to send chunks of data from a file using an array declared inside a structure through XDR. The idea is to establish a client server communication encoded with XDR.

struck response{
float data[5];
bool error;
}myreq;

I may have to use the following functions but i'm not sure. If yes, in which order?

xdrmem_create()
xdrstdio_create()
xdr_array()

Note: Am using C language in linux environment. Any help would be appreciated

fresh learner
  • 467
  • 4
  • 22

1 Answers1

0

You should use xdr_xdrrec_create(), providing your own read and write routines that read to/write from the socket. You should then write, or generate, an xdr_response() method for your struct response that calls xdr_array() for the array and xdr_bool() for the boolean.

user207421
  • 305,947
  • 44
  • 307
  • 483