private void WriteExceptionResponse(PipeConnection pipe, string exceptionMessage) { try { MemoryStream stream = new MemoryStream(System.Text.Encoding.ASCII.GetBytes(exceptionMessage)); pipe.BeginWriteMessage(); pipe.Write(stream); pipe.EndWriteMessage(); } catch { } }
private void WriteClientResponse(PipeConnection pipe, ITransportHeaders headers, Stream responseStream) { String uri; Object oUri = headers[CommonTransportKeys.RequestUri]; if (oUri != null) { uri = oUri.ToString(); } else { uri = ""; } pipe.BeginWriteMessage(); pipe.WriteHeaders( uri, headers); pipe.Write(responseStream); pipe.EndWriteMessage(); }