Exemple #1
0
 internal void ReadDataFromPipe()
 {
     while (true)
     {
         Log.Debug("Waiting for message from native host...");
         var bytes = NativeMessageSerializer.ReadMessageBytes(pipe);
         Log.Debug($"Message from native host {bytes.Length} bytes");
         this.MessageReceived?.Invoke(this, new NativeMessageEventArgs(bytes));
     }
 }
Exemple #2
0
 internal void Start(byte[] initialConfig)
 {
     try
     {
         readerThread.Start();
         NativeMessageSerializer.WriteMessage(pipe, initialConfig);
     }
     catch (Exception ex)
     {
         Log.Debug(ex, ex.Message);
     }
 }
Exemple #3
0
 internal void Publish(byte[] data)
 {
     try
     {
         NativeMessageSerializer.WriteMessage(pipe, data);
         pipe.Flush();
     }
     catch (Exception ex)
     {
         Log.Debug(ex, ex.Message);
     }
 }