Mixedrealitytoolkit-unity: vNext Task: Define core networking interfaces

Created on 4 Jan 2019  路  7Comments  路  Source: microsoft/MixedRealityToolkit-Unity

Overview

Goals:

  • Componentized (ie task focused interfaces)
  • Flexible for virtually any transport
  • Will serve as the basis for higher level networking and sharing components

Current thinking can be found in #3243 and the attached image.

20190104_105504

Sharing / Networking

Most helpful comment

Good serialization code will also only allow specific Object types, due to the potential for malicious users injecting hostile data packets that de-serialize into system takeovers :)

All 7 comments

When sending and receiving an Object, does that imply it will serialize/deserialize that Object for network transfer? Since serialization is a big topic, it might be nice to know the serialization capabilities of the network API underneath. I'd love to be able to query if my particular Object can or cannot be serialized before trying to send it!

When sending and receiving an Object, does that imply it will serialize/deserialize that Object for network transfer?

Good question! Object was a placeholder in the above. It may be that the API should support only simpler times like strings and arrays of intrinsic types, though being able to send a serializable object would be an ideal overload.

Looks like we should be able to check if a type is serializable on most platforms...

https://docs.microsoft.com/en-us/dotnet/api/system.type.isserializable?view=netframework-4.7.2

Good serialization code will also only allow specific Object types, due to the potential for malicious users injecting hostile data packets that de-serialize into system takeovers :)

Good serialization code will also only allow specific Object types, due to the potential for malicious users injecting hostile data packets that de-serialize into system takeovers :)

Excellent point, @maluoi! Thanks for keeping us honest! :)

Let's include an args object in the Send method. There will be cases where devs will need to specify things like delivery targets (all vs specific user), delivery method (direct vs via server), etc etc.

Dumping optional stuff into an extendable args class will future proof the interface without cluttering it up.

Send([TBD] obj, ICancelationToken token, SendArgs args = null)

Since serialization is a big topic, it might be nice to know the serialization capabilities of the network API underneath.

Agreed, and since writing a truly universal serializer is an impossible task devs should have the option to provide a their own. There will be cases where our default can't meet their needs regarding speed / security / bandwidth / platform / whatever:

public interface INetworkSession 
{
     void SetFormatter (IRemotingFormatter formatter);
     ...
}

Sharing will be a standalone component in a separate repo. Please join the public sharing weekly shiproom for details :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

amfdeluca picture amfdeluca  路  3Comments

dustin2711 picture dustin2711  路  3Comments

overedge picture overedge  路  3Comments

nuernber picture nuernber  路  3Comments

MatteoFantasy picture MatteoFantasy  路  3Comments