private void Listen() { while (true) { try { _connection.Connect(); ProcessRequest(_connection.Read()); } catch (Exception ex) { _provider.LogWarning( string.Format(SR.GoJanusListener.PipeListenerErrorMessage, ex.Message)); } }
public void StartPipeServer() { isListening = true; ServerPipeConnection PipeConnection = new ServerPipeConnection(pipeName, 512, 512, 5000, false); Task.Run(() => { while (isListening) { PipeConnection.Disconnect(); PipeConnection.Connect(); try { string request = PipeConnection.Read(); onMessage?.Invoke(this, JsonConvert.DeserializeObject <pipeMessageData <object> >(request)); } catch (Exception ex) { } } PipeConnection.Dispose(); }); }
internal void Connect() { CheckIfDisposed(); PipeConnection.Connect(); }