{"action":"created","issue":{"url":"https://api.github.com/repos/nasa/XPlaneConnect/issues/139","repository_url":"https://api.github.com/repos/nasa/XPlaneConnect","labels_url":"https://api.github.com/repos/nasa/XPlaneConnect/issues/139/labels{/name}","comments_url":"https://api.github.com/repos/nasa/XPlaneConnect/issues/139/comments","events_url":"https://api.github.com/repos/nasa/XPlaneConnect/issues/139/events","html_url":"https://github.com/nasa/XPlaneConnect/issues/139","id":376137985,"node_id":"MDU6SXNzdWUzNzYxMzc5ODU=","number":139,"title":"Java getDREF get same value back first 20 times, then progresses","user":{"login":"aholland","id":1101312,"node_id":"MDQ6VXNlcjExMDEzMTI=","avatar_url":"https://avatars3.githubusercontent.com/u/1101312?v=4","gravatar_id":"","url":"https://api.github.com/users/aholland","html_url":"https://github.com/aholland","followers_url":"https://api.github.com/users/aholland/followers","following_url":"https://api.github.com/users/aholland/following{/other_user}","gists_url":"https://api.github.com/users/aholland/gists{/gist_id}","starred_url":"https://api.github.com/users/aholland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aholland/subscriptions","organizations_url":"https://api.github.com/users/aholland/orgs","repos_url":"https://api.github.com/users/aholland/repos","events_url":"https://api.github.com/users/aholland/events{/privacy}","received_events_url":"https://api.github.com/users/aholland/received_events","type":"User","site_admin":false},"labels":[{"id":140549920,"node_id":"MDU6TGFiZWwxNDA1NDk5MjA=","url":"https://api.github.com/repos/nasa/XPlaneConnect/labels/type:%20question","name":"type: question","color":"cc317c","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-10-31T20:02:28Z","updated_at":"2018-10-31T20:39:59Z","closed_at":null,"author_association":"NONE","body":"Hi. If I try to do the following with line 2 in a loop as XPlane is starting up, it throws exceptions before it can connect (fine) and then returns the first time it gets, 20 times, and then starts getting updated times. The updated times remain behind the time shown on screen in XPlane in the DataRefsEditor plugin.\r\n1.  'val xpc = new XPlaneConnect()'\r\n2.  'xpc.getDREF(\"sim/time/total_flight_time_sec\")'\r\n\r\nThe first value is always read exactly 20 times before it starts to read in changed, new values. It doesn't matter whether I set a delay of 3 seconds between attempts, 100ms, - it gets the same value 20 times before making progress, and somehow stays behind. To me this says that there is probably a buffer of 20 UDP requests somewhere in the plugin.\r\n\r\nCould you throw any light on this please?"},"comment":{"url":"https://api.github.com/repos/nasa/XPlaneConnect/issues/comments/434839767","html_url":"https://github.com/nasa/XPlaneConnect/issues/139#issuecomment-434839767","issue_url":"https://api.github.com/repos/nasa/XPlaneConnect/issues/139","id":434839767,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNDgzOTc2Nw==","user":{"login":"jason-watkins","id":1038224,"node_id":"MDQ6VXNlcjEwMzgyMjQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1038224?v=4","gravatar_id":"","url":"https://api.github.com/users/jason-watkins","html_url":"https://github.com/jason-watkins","followers_url":"https://api.github.com/users/jason-watkins/followers","following_url":"https://api.github.com/users/jason-watkins/following{/other_user}","gists_url":"https://api.github.com/users/jason-watkins/gists{/gist_id}","starred_url":"https://api.github.com/users/jason-watkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jason-watkins/subscriptions","organizations_url":"https://api.github.com/users/jason-watkins/orgs","repos_url":"https://api.github.com/users/jason-watkins/repos","events_url":"https://api.github.com/users/jason-watkins/events{/privacy}","received_events_url":"https://api.github.com/users/jason-watkins/received_events","type":"User","site_admin":false},"created_at":"2018-10-31T20:39:59Z","updated_at":"2018-10-31T20:39:59Z","author_association":"MEMBER","body":"I think I've got it, but a minimal complete example would be nice to be sure.\r\n\r\nUnfortunately, I think the architecture of X-Plane Connect is really not amenable to this use case. I have a feeling that what you're seeing is caused by the fact that the UDP socket on the plugin side is created when the plugin is enabled, but doesn't do any processing until the flight loop starts. The trouble is, while the client may have already timed out, the plugin doesn't know that, so it sends a response anyway. This is compounded by the fact that the current wire protocol doesn't have any way of identifying which response goes with which request, so the client will pull down the response to a timed out request and return it as though it's a response to the current request. This in turn means that the next request will get the response meant for the previous request, explaining the delay once things start to update.\r\n\r\nI don't really have a solution right now. In the long term, I'm working on rewriting the wire protocol to fix issues like this, but X-Plane Connect is just a side project for me now, so it could be many months before I have anything ready to distribute.\r\n\r\n"}}
{"actor":{"display_login":"jason-watkins"}}