fix: Tidy up socket dispose. (#1334)
This commit is contained in:
parent
14ef1ab7e5
commit
44c69620a6
3 changed files with 46 additions and 48 deletions
|
|
@ -5,5 +5,9 @@ namespace Server.Network;
|
|||
public static class OutgoingPackets
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool CannotSendPackets(this NetState ns) => ns?.Connection == null || ns.BlockAllPackets;
|
||||
public static bool CannotSendPackets(this NetState ns) =>
|
||||
// Do not check for NetState.Running. Packets are sent to a "disconnected" socket as part of the OnDisconnect events
|
||||
// up until the Connection is nulled. Closing the connection is done synchronously, therefore packets will not be sent
|
||||
// once the Mobile.NetState is null.
|
||||
ns?.Connection == null || ns.BlockAllPackets;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue