mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-08-31 19:08:29 +00:00
fix: correct event subscription logic in GenericCommunicationMonitor and poll inclusively.
deregister client.BytesReceived and client.TextReceived events before registering preventing multiple event registrations and trigger poll independant of iSocket condition.
This commit is contained in:
parent
3d91723ab0
commit
e738195a2f
1 changed files with 4 additions and 5 deletions
|
|
@ -151,17 +151,16 @@ namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
if (MonitorBytesReceived)
|
if (MonitorBytesReceived)
|
||||||
{
|
{
|
||||||
Client.BytesReceived += Client_BytesReceived;
|
Client.BytesReceived -= Client_BytesReceived;
|
||||||
|
Client.BytesReceived += Client_BytesReceived;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Client.TextReceived -= Client_TextReceived;
|
||||||
Client.TextReceived += Client_TextReceived;
|
Client.TextReceived += Client_TextReceived;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsSocket)
|
BeginPolling();
|
||||||
{
|
|
||||||
BeginPolling();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e)
|
void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue