예제 #1
0
        public void ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, out ITransportHeaders responseHeaders, out Stream responseStream)
        {
            responseHeaders = null;
            responseStream  = null;

            requestHeaders[CommonTransportKeys.RequestUri] = ((IMethodCallMessage)msg).Uri;

            // connect
            NamedPipeClient client = new NamedPipeClient(pipeName);
            NamedPipeSocket socket = client.Connect();
            IpcTransport    t      = new IpcTransport(socket);

            t.Write(requestHeaders, requestStream);
            t.Read(out responseHeaders, out responseStream);
            t.Close();
        }
예제 #2
0
        public void AsyncProcessRequest(IClientChannelSinkStack sinkStack, IMessage msg, ITransportHeaders headers, Stream stream)
        {
            headers[CommonTransportKeys.RequestUri] = ((IMethodCallMessage)msg).Uri;

            // connect
            NamedPipeClient client = new NamedPipeClient(pipeName);
            NamedPipeSocket socket = client.Connect();
            IpcTransport    t      = new IpcTransport(socket);

            t.Write(headers, stream);

            // schedule an async call
            if (!RemotingServices.IsOneWay(((IMethodCallMessage)msg).MethodBase))
            {
                new AsyncResponse(AsyncHandler).BeginInvoke(sinkStack, t, null, null);
            }
        }
예제 #3
0
        public void ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, out ITransportHeaders responseHeaders, out Stream responseStream)
        {
            responseHeaders = null;
            responseStream = null;

            requestHeaders[CommonTransportKeys.RequestUri] = ((IMethodCallMessage)msg).Uri;

            // connect
            NamedPipeClient client = new NamedPipeClient(pipeName);
            NamedPipeSocket socket = client.Connect();
            IpcTransport t = new IpcTransport(socket);
            t.Write(requestHeaders, requestStream);
            t.Read(out responseHeaders, out responseStream);
            t.Close();
        }
예제 #4
0
        public void AsyncProcessRequest(IClientChannelSinkStack sinkStack, IMessage msg, ITransportHeaders headers, Stream stream)
        {
            headers[CommonTransportKeys.RequestUri] = ((IMethodCallMessage)msg).Uri;

            // connect
            NamedPipeClient client = new NamedPipeClient(pipeName);
            NamedPipeSocket socket = client.Connect();
            IpcTransport t = new IpcTransport(socket);
            t.Write(headers, stream);

            // schedule an async call
            if (!RemotingServices.IsOneWay(((IMethodCallMessage)msg).MethodBase)) 
            {
                new AsyncResponse(AsyncHandler).BeginInvoke(sinkStack, t, null, null);
            }
        }