public SimpleClient() { IProtocol jsonRpcProtocol = new JsonRpcProtocol(); ITransport webSocketTransport = new WebSocketTransport(); ProtocolRegistry.Instance.RegisterProtocol(jsonRpcProtocol); TransportRegistry.Instance.RegisterTransport(webSocketTransport); RemoteService = ServiceFactory.Discover("http://localhost:8080/service"); RemoteService.OnConnected += new Connected(HandleConnected); Console.ReadKey(); }
public static ServiceWrapper Discover(string configURI) { ServiceWrapper service = new ServiceWrapper(Context.DefaultContext); Context.DefaultContext.OpenConnection(configURI, service.HandleConnected); return service; }