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(); }
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); } }