private void EncoderNotifyProc(int handle, BASSEncodeNotify status, IntPtr user) { if (status == BASSEncodeNotify.BASS_ENCODE_NOTIFY_CAST_TIMEOUT) { this.Server.LastError = StreamingServer.STREAMINGERROR.Error_SendingData; this.Server.LastErrorMessage = "Data sending timeout!"; } else if (status == BASSEncodeNotify.BASS_ENCODE_NOTIFY_ENCODER) { this.Server.LastError = StreamingServer.STREAMINGERROR.Error_EncoderError; this.Server.LastErrorMessage = "Encoder died!"; } else if (status == BASSEncodeNotify.BASS_ENCODE_NOTIFY_CAST) { this.Server.LastError = StreamingServer.STREAMINGERROR.Error_NotConnected; this.Server.LastErrorMessage = "Connection to the server died!"; } else { if (status == BASSEncodeNotify.BASS_ENCODE_NOTIFY_FREE) { this.Server.LastError = StreamingServer.STREAMINGERROR.Ok; this.Server.LastErrorMessage = string.Empty; return; } if (status == BASSEncodeNotify.BASS_ENCODE_NOTIFY_QUEUE_FULL) { this.Server.LastError = StreamingServer.STREAMINGERROR.Warning_LessDataSend; this.Server.LastErrorMessage = "Encoding queue is out of space (some data could not be send to the server)!"; return; } this.Server.LastError = StreamingServer.STREAMINGERROR.Unknown; this.Server.LastErrorMessage = "Unknown encoder status"; return; } this.RaiseNotification(BroadCastEventType.ConnectionLost, DateTime.Now); if (this._retryTimer != null) { this._retryTimer.Change(-1, -1); this._retryTimer.Dispose(); this._retryTimer = null; } if (!this._autoReconnectTryRunning) { ThreadPool.QueueUserWorkItem(new WaitCallback(this.AutoReconnectTry)); } }
private void EncoderNotifyProc(int handle, BASSEncodeNotify status, IntPtr user) { if (status == BASSEncodeNotify.BASS_ENCODE_NOTIFY_CAST_TIMEOUT) { base.LastError = StreamingServer.STREAMINGERROR.Error_SendingData; base.LastErrorMessage = "Data sending timeout!"; } if (status == BASSEncodeNotify.BASS_ENCODE_NOTIFY_ENCODER) { this._isConnected = false; base.LastError = StreamingServer.STREAMINGERROR.Error_EncoderError; base.LastErrorMessage = "Encoder died!"; return; } if (status == BASSEncodeNotify.BASS_ENCODE_NOTIFY_CAST) { this._isConnected = false; base.LastError = StreamingServer.STREAMINGERROR.Error_SendingData; base.LastErrorMessage = "Connection to the server died!"; } }