Extensions
VoltRpc has some first-party extensions for it. These are usually for extending the <xref:System.Type> capability of BufferedWriter and BufferedReader as well as providing TypeReadWriter<T> for usage by a TypeReaderWriterManager.
System.Numerics.Vectors Support
The VoltRpc.Extension.Vectors package provides support for almost all types provided by System.Numerics.Vectors.
To install it, you can add it to your project's csproj
like so:
<ItemGroup>
<PackageReference Include="VoltRpc.Extension.Vectors" Version="1.1.0" />
</ItemGroup>
Once you have the NuGet package installed, you can use the types by using InstallVectorsExtension()
method with the TypeReaderWriterManager.
So for example:
VoltRpc.Communication.Client client = new TCPClient(new IPEndPoint(IPAddress.Loopback, 7767));
client.TypeReaderWriterManager.InstallVectorsExtension();
client.AddService<ITest>();
...
Both the client and host expose their TypeReaderWriterManager using the same field names.
If you wanted to, you can also manually add each type reader/writer.
You can also use the types in your own custom type readers/writers, using the methods provided in BufferedReaderVectorsExtensions and BufferedWriterVectorsExtensions.
System.Memory Support
The VoltRpc.Extension.Memory provides support for Span and Memory. It ONLY adds to the BufferedReader and BufferedWriter. It does NOT add type readers/writers! This package also provides a Span way of reading strings.
To install it, you can add it to your project's csproj
like so:
<ItemGroup>
<PackageReference Include="VoltRpc.Extension.Memory" Version="1.1.0" />
</ItemGroup>
Once you have the NuGet package installed, you can use the methods in BufferedReaderMemoryExtensions and BufferedWriterMemoryExtensions in your custom type readers/writers.