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

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 :)
Most helpful comment
Good serialization code will also only allow specific
Objecttypes, due to the potential for malicious users injecting hostile data packets that de-serialize into system takeovers :)