protected override async Task DoProcess(CancellationToken cancellationToken)
{
this.state = ConnectionState.Waiting;
try {
await Handshake(cancellationToken);
await ProcessRTMPMessages(cancellationToken);
this.state = ConnectionState.Closed;
}
catch (BindErrorException e) {
Logger.Error(e);
Stop(StopReason.NoHost);
this.state = ConnectionState.Error;
}
catch (IOException e) {
Logger.Error(e);
Stop(StopReason.ConnectionError);
this.state = ConnectionState.Error;
}
catch (ConnectionStoppedExcception) {
this.state = ConnectionState.Closed;
}
}