-
Notifications
You must be signed in to change notification settings - Fork 40
Home
tylerje edited this page Nov 5, 2014
·
10 revisions
ServiceWire is a very fast and light weight service host and dynamic client library that simplifies the development and use of high performance remote procedure call (RPC) communication between .NET processes over Named Pipes or TCP/IP.
- Why ServiceWire
- History of ServiceWire
- Like us on Facebook
ServiceWire's dynamically generated proxy will NOT run as x86 on an x64 system. This ususally occurs when you use Visual Studio to create a console application with the default "prefer x86" in project properties selected. Just be sure to choose AnyCPU or the specific target (x86 or x64) so that you do not run 32bit in WOW on an x64 machine.
Key Features:
- Two fast binary protocols: TCP and Named Pipes
- The only RPC service library under active development that supports out and ref parameters
- Dynamically generated client proxy in-memory assembly
- Very fast serialization
- Host multiple service interfaces on single endpoint
- Singleton hosting on multiple protocols and endpoints
- Aspect oriented interceptor with pre-, post- and exception handling cross cutting
- Injectable Logging and Performance Instrumentation
- Optional parameter and return value compression
Write an interface like this:
public interface IMyService
{
Guid GetId(string source, double weight, int quantity, DateTime dt);
TestResponse Get(Guid id, string label, double weight, out long quantity);
long TestLong(out long id1, out long id2);
List<string> GetItems(Guid id);
}
Write your implementation and then host it this easily:
var tcphost = new TcpHost(ipEndpoint, logger, stats);
tcphost.AddService<IMyService>(myService);
tcphost.Open();
Then write your client code to use the service this easily:
using (var client = new TcpClient<IMyService>(ipEndpoint))
{
var id = client.GetId("test1", 3.314, 42);
int q2 = 4;
var response = client.Get(id, "mirror", 4.123, out q2)
var list = client.GetItems(id, new int[] { 3, 6, 9 });
}