private void OnConnectionAvailable(IConnection connection, Action connectionDequeuedCallback) { ConnectionModeReader reader = this.SetupModeReader(connection, false); if (reader != null) { reader.StartReading(this.channelInitializationTimeout, connectionDequeuedCallback); } else { connectionDequeuedCallback(); } }
void OnConnectionAvailable(IConnection connection, Action connectionDequeuedCallback) { ConnectionModeReader modeReader = SetupModeReader(connection, false); if (modeReader != null) { // StartReading() will never throw non-fatal exceptions; // it propagates all exceptions into the onConnectionModeKnown callback, // which is where we need our robust handling modeReader.StartReading(this.channelInitializationTimeout, connectionDequeuedCallback); } else { connectionDequeuedCallback(); } }