예제 #1
0
        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();
        }
예제 #2
0
 public static ServiceWrapper Discover(string configURI)
 {
     ServiceWrapper service = new ServiceWrapper(Context.DefaultContext);
     Context.DefaultContext.OpenConnection(configURI, service.HandleConnected);
     return service;
 }