How can I read custom DREFs created by an X-Plane 11 plugin from SITL?

Hello,

I have been trying to read a custom X-Plane 11 DREF created by my X-Plane 11 plugin from SITL (SIM_XPlane.cpp), using an RREF request udp packet. According to the “Exchanging Data With X-Plane” document, X-Plane sends the reply to the same address and port from where the RREF request was sent.

So, in SIM_XPlane.cpp, I added a socket_out.bind() call to the X-Plane constructor and a socket_out.recv() in receive_data(). But I never receive any RREF reply packets from X-Plane 11. I am using X-Plane 11.41. I’d appreciate any helpful suggestions. Thanks.