{"action":"created","issue":{"url":"https://api.github.com/repos/HagertyRobotics/ftc_app_networked_simulator/issues/6","labels_url":"https://api.github.com/repos/HagertyRobotics/ftc_app_networked_simulator/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/HagertyRobotics/ftc_app_networked_simulator/issues/6/comments","events_url":"https://api.github.com/repos/HagertyRobotics/ftc_app_networked_simulator/issues/6/events","html_url":"https://github.com/HagertyRobotics/ftc_app_networked_simulator/pull/6","id":99349974,"number":6,"title":"Rebuild networking to use TCP vs UDP","user":{"login":"dmssargent","id":10181534,"avatar_url":"https://avatars.githubusercontent.com/u/10181534?v=3","gravatar_id":"","url":"https://api.github.com/users/dmssargent","html_url":"https://github.com/dmssargent","followers_url":"https://api.github.com/users/dmssargent/followers","following_url":"https://api.github.com/users/dmssargent/following{/other_user}","gists_url":"https://api.github.com/users/dmssargent/gists{/gist_id}","starred_url":"https://api.github.com/users/dmssargent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmssargent/subscriptions","organizations_url":"https://api.github.com/users/dmssargent/orgs","repos_url":"https://api.github.com/users/dmssargent/repos","events_url":"https://api.github.com/users/dmssargent/events{/privacy}","received_events_url":"https://api.github.com/users/dmssargent/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2015-08-06T04:22:52Z","updated_at":"2015-08-17T19:05:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/HagertyRobotics/ftc_app_networked_simulator/pulls/6","html_url":"https://github.com/HagertyRobotics/ftc_app_networked_simulator/pull/6","diff_url":"https://github.com/HagertyRobotics/ftc_app_networked_simulator/pull/6.diff","patch_url":"https://github.com/HagertyRobotics/ftc_app_networked_simulator/pull/6.patch"},"body":"The UDP systems requires bonding of ports to a selected number, and if/when the app crashes the port may get leaked. The TCP system requires only one socket to run, (two, if multicast is enabled) one in UDP mode for listening for a multicast. The UDP is also using hardcoded strings for IP addresses in stead of relying on validated user input.\r\n\r\nWhat I have done:\r\n- [x] Re-build the networking components to use the TCP mode, instead of UDP\r\n- [x] Re-factor out the old systems\r\n- [x] Write a new data exchange protocol\r\n- [x] Add options about simulation to the settings menu\r\n\r\nWhat doesn't work:\r\n- [x] ~~Thread safety is apperently not so good (the Android App is throwing a ConcurrentModificationException, which shutdowns the server)~~ EDIT: Not quite: according to Android App thread dumps I am getting caught in a dead spin when I reimplemented the storage queue with a proper object designed for this usage (the old invalidated the iterator in my foreach, when the data got changed from a different thread)\r\n- [x] ~~Console is overflowing - the amount of data being sent and received is causing the console output to noticeably slowdown the application, it is taking its sweet time to catch back up after running for more than a few seconds (right now, one minute of running takes the console writer ten minutes to do)~~ Code to display full data is commented out, otherwise it has an adepquate speed now\r\n- [x] ~~The device list getter/setter doesn't work just yet (probably because of problem one)~~ ~~Is XML Deserializer working?~~\r\n- [ ] Commenting (a need to add quite a few of those)\r\n\r\nWhat we need to do:\r\n- [x] ~~figure out what is happening when a Concurrent Modification Execption gets fired~~\r\n- [x] ~~see what happens when above is fixed~~ see what happens when if it works\r\n- [x] ~~Log the packet data and only display the important details if necessary~~\r\n- [ ] Add a way of turing debug mode on/off*\r\n- [ ] Get and validate user input for an IP address if multicasting is off or fails*\r\n- [ ] Add an option to turn multicasting on or off*\r\n- [x] ~~Add more ways to Stop / restart the Simulator*~~\r\n- [x]  ~~Fix any leaking memory (when the client is left running it caches everything until it gets processed)~~ I have trimmed the memory usage of my side down from 2.5GB to 100MB (client) and 100MB to 16MB (my side) (that's what I get for forgetting to remove a section of the mirror protocol, plus having high data retention policy)\r\n- [ ] Figure out why the networking is acting buggy\r\n\r\n *since you are maintaining the interface, I would recommend you the do the following\r\n\r\nI opened this early so I could get feedback from you and to request changes, it is not ready to be considered alpha yet"},"comment":{"url":"https://api.github.com/repos/HagertyRobotics/ftc_app_networked_simulator/issues/comments/131931617","html_url":"https://github.com/HagertyRobotics/ftc_app_networked_simulator/pull/6#issuecomment-131931617","issue_url":"https://api.github.com/repos/HagertyRobotics/ftc_app_networked_simulator/issues/6","id":131931617,"user":{"login":"dmssargent","id":10181534,"avatar_url":"https://avatars.githubusercontent.com/u/10181534?v=3","gravatar_id":"","url":"https://api.github.com/users/dmssargent","html_url":"https://github.com/dmssargent","followers_url":"https://api.github.com/users/dmssargent/followers","following_url":"https://api.github.com/users/dmssargent/following{/other_user}","gists_url":"https://api.github.com/users/dmssargent/gists{/gist_id}","starred_url":"https://api.github.com/users/dmssargent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmssargent/subscriptions","organizations_url":"https://api.github.com/users/dmssargent/orgs","repos_url":"https://api.github.com/users/dmssargent/repos","events_url":"https://api.github.com/users/dmssargent/events{/privacy}","received_events_url":"https://api.github.com/users/dmssargent/received_events","type":"User","site_admin":false},"created_at":"2015-08-17T19:05:23Z","updated_at":"2015-08-17T19:05:23Z","body":"I seem to have fixed the problem bug, now we can see it gets stuck on init with waiting on the Simulator Device feedback. So, I probably missed something when I updated the simulator to the latest version, I designed the networking to be backwards-compatible with your code (as in the functions that handle specific things should have the exact same behavior as before). I did add the throwing of an Interrupted Exception to the functions that wait for user input, to allow safe termination. Can you specify an overview of how each component is networked, or evaluate your module code to see if I only partially changed something."}}