Skip to content

Switch the Remote plugin and connector over to ProtoBuf

Closes #9 (closed)

While this is a rather large change, the majority of it was to support having a test harness for future bandwidth optimisation tests. The current test handily runs a server instance and a client instance connected with one another and takes the latest upload/download speeds at the end to compare to some arbitrary bench numbers. I'm checking that there is at least some data transfer and that it does not exceed 250 KB/s.

Overall the switch to ProtoBuf is relatively small and yielded great success. Using the MockedConnector it looks like the switch to ProtoBuf yielded a reduction of upload bandwidth usage by 90%! I'm extremely happy with this and it brings me one step closer to being able to have a remote race engineer. It will go a long way to closing #9 (closed) once and for all as an issue.

Considerations

This change also completely breaks backwards compatibility so people will have to ensure that both instances of Second Monitor up-to-date if they want to use the remote functionality. I do feel that using BinaryFormatter is a huge security risk if you're exposing a broadcast server over the internet as is my intent so I'd rather rest assured that I'm not vulnerable to remote code execution even if the risk is relatively small for this use-case.

The test harness required that I switch out using Application.Current.Dispatcher for Dispatcher.CurrentDispatcher in order to enable running in a test environment. My testing of the app still has everything running smoothly so I'm sure this change can be substituted everywhere else and I'd be more than happy to make the change as part of this Merge Request if you want me to.

I also introduced the Ninject.Extensions.Factory NuGet package which allows the injection of Lazy<T> dependencies. It's currently only used in the Remote.Connector project so I made the accompanying NinjectModule and bootstrapper classes as well while making the bootstrapper responsible for ensuring the FuncModule from the package is loaded into the kernel.

Edited by Sas van der Westhuizen

Merge request reports