Wednesday, April 13, 2016

Python XDR TCP stream

Leave a Comment

I have a C socket server who receive XDR data. I have wrote a 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 via the server data are different. This is because data are encoded as to be read via a xdrmem decoder. (they do not have start and end of record).

Does anyone know if there is a library for python who support the creation of xdr records? In c this is done via xdrrec_create and in Java this is called XdrTcpEncodingStream.

1 Answers

Answers 1

I mostly see xdrlib is the package mostly used. When you have processes that can be done in C or Java, You can just run them in c/java and use it in python by using and interface created by Swig. Let me know if my understanding doesn't suit the scenario.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment