Python XDR TCP Stream

I have a C socket server that receives XDR data. I wrote C and a Java client. I am trying to write a Python client using xdrlib .

 import xdrlib p = xdrlib.Packer() p.pack_int(5) p.pack_int(4) p.pack_int(3) data = p.get_buffer() 

When I decode this through the server, the data is different. This is because the data is encoded for reading through the xdrmem decoder. (they have no beginning or end to the recording).

Does anyone know if there is a library for python that supports xdr writing? In c, this is done through xdrrec_create , and in Java it is called XdrTcpEncodingStream .

+5
source share
1 answer

Basically I see xdrlib used mainly in the package. When you have processes that can be executed in C or Java , you can simply run them in c / java and use it in python using the interface created using Swig . Let me know if my understanding does not fit the script.

-2
source

Source: https://habr.com/ru/post/1245470/


All Articles