...
The interface you use to communicate (IMyModelApi in the example above) should follow a few basic rules to work smoothly with the remoting implementation. Any interface will do: no special attributes are required, but you should try to use mostly simple (value) types (as is common when defining an interface of a native dll).
Supported Default supported types:
- all primitive types (int, double, string, etc)
- enums
- NOT decimal
Wiki Markup double\[\], bool\[\], int\[\], short\[\], float\[\], byte\[\]
- 'Array' if of above type at runtime!
- ref/out keywords
- Type (through type converter)
- DateTime (through type converter)
- ..more through type converters
To support custom classes a little bit of extra work is required. You can either annotate the class with the required attributes for serialization (see below), or you can introduce a type converter which does custom serialization (see DateTimeToProtoConverter.cs). The latter is useful if you do not have access to the source code (eg, a .NET object) or do not which to mix remoting and domain.
...
- More work / less calls is better
- Send large multi dimensional arrays as one dimensional
- Avoid large arrays in custom types as they aren't optimized
- If in doubt, ask! The code can be changed / extended to support more options!
Additionally for your purpose it might be beneficial to re-use remote instances, start them in advance (warmup), or run multiple concurrent!