Connection drop between XPlane 12 and MAVProxy SITL

Hi,
I am trying to autotune a custom plane integrated into xplane 12, I had initially tried to run ardupilot-> arduplane as SITL from mission planner but had issues with the joystick commands from mission planner not conveyed to xplane. Hence I transitioned towards Mavproxy and built a 4.2.0 version of arduplane and had good results by gaining joystick controls.
Currently I am getting an error message “Connection reset or closed by peer on TCP socket Attempting reconnect " this happens when i try to change my flight mode. Once this error message pops up, i get a continues error message of " [WinError 10061] No connection could be made because the target machine actively refused it” , which after some googling found that the port over which the communication occurs is crashing.
I have tried nearly all arguments available in ./waf but to no avail.
Also while running arduplane version 4.2.0 with xplane 12 through mavproxy, the starboard(right) side aileron does’nt respond to joystick inputs whereas all other control surfaces respond as intended.
Any help on this matter would be really helpful.