Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Secondary TCP connections do not get initial subscribed value as expected #22

Closed
waynepiekarski opened this issue Feb 4, 2018 · 7 comments

Comments

@waynepiekarski
Copy link
Contributor

I am using the latest ExtPlane master. I have noticed that with one connection, everything works fine, but if you have 2 or more connections, the initial value is not shown for "sub" commands.

For example, start up a terminal #1 with:
echo "sub sim/aircraft/view/acf_descrip" | nc $HOSTNAME 51000

You will see:
EXTPLANE 1
ub sim/aircraft/view/acf_descrip WmlibyBCb2VpbmcgNzM3LTgwMFg=

If you open a new terminal #2 with the same command, you will see:
EXTPLANE 1

In terminal #1, you will see it gets an update with the same value:
ub sim/aircraft/view/acf_descrip WmlibyBCb2VpbmcgNzM3LTgwMFg=

If you open a terminal #3, you will see terminal #1 and #2 get an update but #3 has no value.

So it seems like when a new connection requests a sub, the other connections get the value and not the requestor. There must be a bug in the code which sends the initial value to new subscribers. Once the value changes in X-Plane, then all listeners get the update correctly.

@vranki
Copy link
Owner

vranki commented Feb 5, 2018

Sounds like a bug indeed. Will be studied and fixed. Thanks for reporting!

@vranki
Copy link
Owner

vranki commented Feb 9, 2018

Does this happen with only data datarefs or all dataref types?

@waynepiekarski
Copy link
Contributor Author

I just tried it with echo "sub sim/aircraft/engine/acf_num_engines" | nc $HOSTNAME 51000 and it has the same problem with not showing the value initially.

I also noticed that I don't seem to be able to get datarefs like sim/operation/misc/frame_rate_period or sim/cockpit2/controls/flap_handle_deploy_ratio ... if I add [0] it does nothing, and if I remove the [0] it crashes the whole simulator. I am able to access these values as floats via UDP RREFs.

vranki pushed a commit that referenced this issue Feb 14, 2018
@vranki
Copy link
Owner

vranki commented Feb 14, 2018

I found reason for the issue and have made a potential fix in branch 22-fix-secondary-connections
Could you try that and see if it helps?

@waynepiekarski
Copy link
Contributor Author

Hi there. I tested your new branch out and it seems to work pretty well, and fixes up all the issues I have identified. Thanks for fixing this.

Are you planning on doing a v2 release some time?

@vranki
Copy link
Owner

vranki commented Feb 18, 2018

I have merged the changes in the branch to master.

Problem with releases is that I mostly develop on Linux so I won't be making Mac & Windows build. With mxe it's possible to make automated Windows builds in Travis, but that's still WIP.

@waynepiekarski
Copy link
Contributor Author

I think I have found another bug related to the array values are handled, filed as #26, which is not fixed by this patch. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants