TagBites.Net
Lightweight and simple TCP client-server .NET library with RMI support.
NuGet Package: https://www.nuget.org/packages/TagBites.Net/
Chat example
Client code
Server code
In this example a string
type is used for communication, but any serializable objects can be send/received.
By default System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
is used for serialization, but it can be replaced with a custom implementation.
Full example on github: TagBites.Net-Sample-Chat.
Chat example using RMI (Remote Method Invocation)
Client code
The method Use<TControllerInterface, TController>()
registers a controller that can be used by the server. The server site can use the IChatClient
interface to execute methods implemented by ChatClient
on the client's site. The client/server can registers many controllers. The controller instance will be created on first use.
GetController<T>()
returns the proxy interface to the class register in the remote site. The calling method in this instance will invoke method in the remote site. The Controller can invoke methods with primitive or serializable parameter types and returns void/Task or any primitive or serializable type.
Server code
Classes
Full example on github: TagBites.Net-Sample-ChatWithControllers.