Undo the connection change for Hermes client.
This commit is contained in:
parent
75fa154546
commit
4099322ce2
@ -34,7 +34,6 @@ namespace TwitchChatTTS.Hermes.Socket
|
|||||||
public bool LoggedIn { get; set; }
|
public bool LoggedIn { get; set; }
|
||||||
public bool Ready { get; set; }
|
public bool Ready { get; set; }
|
||||||
|
|
||||||
private bool _attempting;
|
|
||||||
|
|
||||||
|
|
||||||
public HermesSocketClient(
|
public HermesSocketClient(
|
||||||
@ -85,29 +84,23 @@ namespace TwitchChatTTS.Hermes.Socket
|
|||||||
{
|
{
|
||||||
lock (_lock)
|
lock (_lock)
|
||||||
{
|
{
|
||||||
if (Connected || _attempting)
|
if (Connected)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_attempting = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.Debug($"Attempting to connect to {URL}");
|
_logger.Debug($"Attempting to connect to {URL}");
|
||||||
await ConnectAsync(URL);
|
await ConnectAsync(URL);
|
||||||
_attempting = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task Disconnect()
|
private async Task Disconnect()
|
||||||
{
|
{
|
||||||
lock (_lock)
|
lock (_lock)
|
||||||
{
|
{
|
||||||
if (!Connected || _attempting)
|
if (!Connected)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_attempting = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await DisconnectAsync(new SocketDisconnectionEventArgs("Normal disconnection", "Disconnection was executed"));
|
await DisconnectAsync(new SocketDisconnectionEventArgs("Normal disconnection", "Disconnection was executed"));
|
||||||
_attempting = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task CreateTTSVoice(string voiceName)
|
public async Task CreateTTSVoice(string voiceName)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user