Implement pong response to ping in websocketroutinghandler.

This commit is contained in:
Alexandru Macocian
2021-03-15 16:00:27 +01:00
parent 619992da80
commit 3fbfe4ee2e
2 changed files with 9 additions and 8 deletions
+3 -3
View File
@@ -5,13 +5,13 @@
<TargetFrameworks>netcoreapp2.1;net48;netstandard2.0;netcoreapp3.1;net5.0</TargetFrameworks>
<ApplicationIcon />
<StartupObject />
<Version>3.2</Version>
<Version>3.2.1</Version>
<LangVersion>latest</LangVersion>
<Authors>Alexandru-Victor Macocian</Authors>
<Product>MTSC</Product>
<Description>Modular TCP Server and Client</Description>
<AssemblyVersion>0.3.2</AssemblyVersion>
<FileVersion>0.3.2</FileVersion>
<AssemblyVersion>0.3.2.1</AssemblyVersion>
<FileVersion>0.3.2.1</FileVersion>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Platforms>AnyCPU;x64</Platforms>
<PackageProjectUrl>https://github.com/AlexMacocian/MTSC</PackageProjectUrl>
@@ -204,11 +204,12 @@ namespace MTSC.ServerSide.Handlers
if (receivedMessage.Opcode == WebsocketMessage.Opcodes.Close)
{
client.ToBeRemoved = true;
WebsocketMessage closeFrame = new WebsocketMessage
{
Opcode = WebsocketMessage.Opcodes.Close
};
this.QueueMessage(client, closeFrame);
this.QueueMessage(client, new byte[0], WebsocketMessage.Opcodes.Close);
return true;
}
else if (receivedMessage.Opcode == WebsocketMessage.Opcodes.Ping)
{
this.QueueMessage(client, new byte[0] ,WebsocketMessage.Opcodes.Pong);
return true;
}
else