Ignore errors when try to close already closed WebSockets
This commit is contained in:
parent
7362062556
commit
9491304b01
1 changed files with 10 additions and 3 deletions
|
|
@ -327,11 +327,18 @@ namespace Server.Network.Sockets
|
|||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
try
|
||||
{
|
||||
const byte header1 = 0b1000_0000 | (byte)OpCode.Close;
|
||||
Socket.Send([header1, 0]);
|
||||
Socket.Close();
|
||||
}
|
||||
catch
|
||||
{
|
||||
/* ignore already closed sockets */
|
||||
}
|
||||
}
|
||||
|
||||
private enum OpCode : byte
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue