Search code examples
c#unity-game-enginevirtual-realityserver-side-rendering

VR application (Unity with TrinusVR lib) Windows build: Connection reset


I am developing a VR application using Unity 2018.2.8f1 and the TrinusVR lib (a framework that does serverside rendering). When I press play in the editor or build for Linux it works as expected. However, when using the Windows build, only about one frame gets transmitted to the client, then the connection is reset. On the client it shows the errors:

Error streaming video error: java.net.SocketException: Connection reset

Error Error delivering sensor data: java.net.SocketException: Connection reset

Digging into into the logs of the server it seems that this reset is caused by a null reference exception:

Disconnected (Reason: ERROR:ERR_IMG_PROC:Could not deliver frame to client. System.TypeInitializationException: The type initializer for 'ManagedToNativeWrapper' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object at System.Drawing.ComIStreamMarshaler+ManagedToNativeWrapper..cctor () [0x00049] in :0`

Does somebody know, what is wrong here? Has anybody seen this problem before?

You can find the complete log files (Windows 10 server and android 7 client) here: https://transfernow.net/419cp2m92898

Thank you


Solution

  • Turns out that it actually is a problem of the .NET version on Windows as the trinus lib is made for an older version. Setting the right parameters in Edit > Project Settings > Player, section Other Settings, resolves:

    • Scripting Runtime Version: .NET 3.5 Equivalent
    • Api Compatibility Level: .NET 2.0