internal unsafe void Write(Action <StreamHandler> callback) { Monitor.Enter(writeSyncRoot); try { fixed(byte *buf = &streamHandler.writeBuffer[0]) { streamHandler.fixedWriteBuffer = buf; if (!connected) { Connect(pipeOut); streamHandler.Write(localProcessId); streamHandler.Flush(); connected = true; } callback.Invoke(streamHandler); streamHandler.Flush(); streamHandler.fixedWriteBuffer = null; } } catch (EndOfStreamException) { } catch (IOException) { } catch (ObjectDisposedException) { } finally { Monitor.Exit(writeSyncRoot); } }
internal void WriteResponse(StreamHandler h) { h.Write(ushort.MaxValue); h.Write(remoteThreadId); WriteReturn(h); h.Flush(); }
internal void WriteRequest(StreamHandler h) { h.Write((ushort)callId); if (!returnImmediately) { h.Write(localThreadId); h.Write(remoteThreadId); } WriteArgs(h); h.Flush(); }
internal void Write(Action <StreamHandler> callback) { Monitor.Enter(writeSyncRoot); try { if (!connected) { Connect(pipeOut); streamHandler.Write(localProcessId); streamHandler.Flush(); connected = true; } callback.Invoke(streamHandler); streamHandler.Flush(); } catch (EndOfStreamException) { } catch (IOException) { } catch (ObjectDisposedException) { } finally { Monitor.Exit(writeSyncRoot); } }
internal void WriteLoopEntry() { try { Connect(pipeOut); streamHandler.Write(localProcessId); streamHandler.Flush(); WriteLoop(); } catch (EndOfStreamException ex) { OnConnectionLost(ex); } catch (IOException ex) { OnConnectionLost(ex); } }
internal void Write(Action <StreamHandler> callback) { Monitor.Enter(syncRoot); try { if (!connected) { Connect(pipeOut); streamHandler.Write(localProcessId); streamHandler.Flush(); connected = true; } callback.Invoke(streamHandler); } catch (EndOfStreamException ex) { OnConnectionLost(ex); } catch (IOException ex) { OnConnectionLost(ex); } finally { Monitor.Exit(syncRoot); } }