Skip to content

Multiple Interfaces Overview

tylerje edited this page Oct 23, 2014 · 1 revision

ServiceWire is able to host multiple services on one end point as shown below.

Warning: You cannot host multiple instances of the same interface on the same end point. An exception will be thrown if you try.

 var tcphost = new TcpHost(ipEndpoint, logger, stats);
 tcphost.AddService<INetTester>(tester);
 tcphost.AddService<IMyTester>(mytester);

This allows you to follow the interface segregation principle. Your implementation class could easily implement multiple interfaces and expose those interfaces as separate services.

Clone this wiki locally