DouglasDwyer.Imp
1.0.0.1
dotnet add package DouglasDwyer.Imp --version 1.0.0.1
NuGet\Install-Package DouglasDwyer.Imp -Version 1.0.0.1
<PackageReference Include="DouglasDwyer.Imp" Version="1.0.0.1" />
paket add DouglasDwyer.Imp --version 1.0.0.1
#r "nuget: DouglasDwyer.Imp, 1.0.0.1"
// Install DouglasDwyer.Imp as a Cake Addin #addin nuget:?package=DouglasDwyer.Imp&version=1.0.0.1 // Install DouglasDwyer.Imp as a Cake Tool #tool nuget:?package=DouglasDwyer.Imp&version=1.0.0.1
Imp.NET
Imp.NET is a fast, high-level, object-oriented C# networking library that supports the invocation of remote methods through proxy interface objects. Imp.NET combines the power of the System.Reflection.Emit
namespace with the flexibility of source generators to provide a seamless networking experience, without the hassle of network streams or pesky sockets. With Imp.NET, one writes networked code that looks identical to fully local code. Its fast and powerful features make it the perfect choice for any C# application.
Imp.NET may optionally be used without its source generator.
Features
With Imp.NET, you can:
- Write networked code with remote method calls that looks exactly like normal/local code
- Send shared objects as method arguments across the network via interfaces, and remotely invoke methods/properties on them as though they are local objects
- Send non-shared objects as method arguments across the network by value using a serializer
- Pass any class that inherits from an interface, including library classes, across the network as a shared interface
- Call remote methods synchronously or asynchronously with the use of
Task
s and theawait
keyword - Use UDP and the
Unreliable
attribute to send data across the network with less overhead
Installation
Imp.NET can be obtained as a Nuget package. To import it into your project, either download DouglasDwyer.Imp from the Visual Studio package manager or run the command Install-Package DouglasDwyer.Imp
using the package manager console.
Getting started
Please see the documentation for a complete guide on setting up an Imp.NET application.
Example
Imp.NET abstracts away the details of networking by automatically generating remote proxy classes that inherit from shared interfaces. In the following client-side example, a client connects to a server, then gets a remote representation of the server object, which is of the user-defined type IChatServer
. Then, the client repeatedly sends messages read from the console to the server. Despite the fact that the code is executing client-side, the call to SendMessage
executes on the server, as the server
variable is a remote/server-owned object:
ChatClient client = new ChatClient();
client.Connect("127.0.0.1", 10);
IChatServer server = client.Server;
while(true)
{
server.SendMessage(Console.ReadLine());
}
Thus, Imp.NET provides an incredibly simple way for clients and servers to interact. The user can define custom "shared" properties and methods. These members may then be accessed remotely, as though they existed in the local runtime.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- DouglasDwyer.PowerSerializer (>= 1.0.0.3)
- System.Reflection.Emit (>= 4.7.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Fixed documentation for release