예제 #1
0
 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);
     }
 }
예제 #2
0
 internal void WriteResponse(StreamHandler h)
 {
     h.Write(ushort.MaxValue);
     h.Write(remoteThreadId);
     WriteReturn(h);
     h.Flush();
 }
예제 #3
0
 internal void WriteRequest(StreamHandler h)
 {
     h.Write((ushort)callId);
     if (!returnImmediately)
     {
         h.Write(localThreadId);
         h.Write(remoteThreadId);
     }
     WriteArgs(h);
     h.Flush();
 }
예제 #4
0
 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);
     }
 }
예제 #6
0
 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);
     }
 }