예제 #1
0
        public PipeRpcServer(PipeRpcServerMode mode)
        {
            _mode = mode;

            _inStream = new AnonymousPipeServerStream(PipeDirection.In, HandleInheritability.Inheritable);
            _reader   = new JsonTextReader(new CustomStreamReader(_inStream))
            {
                SupportMultipleContent = true,
                DateParseHandling      = DateParseHandling.None
            };
            _outStream = new AnonymousPipeServerStream(PipeDirection.Out, HandleInheritability.Inheritable);
            _writer    = new JsonTextWriter(new StreamWriter(_outStream));

            _serializer = JsonSerializer.CreateDefault();

            Handle = new PipeRpcHandle(_inStream.GetClientHandleAsString(), _outStream.GetClientHandleAsString());
        }
예제 #2
0
        public PipeRpcClient(PipeRpcHandle handle, object service, Type serviceType)
        {
            var inStream = new AnonymousPipeClientStream(PipeDirection.In, handle.OutHandle);

            _reader = new JsonTextReader(new CustomStreamReader(inStream))
            {
                SupportMultipleContent = true,
                DateParseHandling      = DateParseHandling.None
            };
            var outStream = new AnonymousPipeClientStream(PipeDirection.Out, handle.InHandle);

            _writer = new JsonTextWriter(new StreamWriter(outStream));

            _serializer = JsonSerializer.CreateDefault();

            _service            = service;
            _serviceDescription = ServiceDescription.FromType(serviceType);
        }
예제 #3
0
 public PipeRpcClient(PipeRpcHandle handle, object service)
     : this(handle, service, service.GetType())
 {
 }