void IOThread() { try { socket.Connect(); socket.ReadLoop(); } catch (Exception ex) { Logger.LogError("Discord relay error", ex); if (disconnecting) { return; } // try to recover from dropped connection TryReconnect(); } }
protected override void DoReadLoop() { try { socket.ReadLoop(); } catch (Exception ex) { Exception unpacked = UnpackError(ex); // throw a more specific exception if possible if (unpacked != null) { throw unpacked; } // rethrow original exception otherwise throw; } }
protected override void DoReadLoop() { socket.ReadLoop(); }