Thanks for providing the details. I have tested with the Fleck library in my last post. If i send the ping frame, the ws server invokes the message callback(incoming) while not ping callback(heartbeat). In another hand, I also tried with a package named Chilkat.WebSocket, it works fine.
Chilkat.WebSocket ws = new Chilkat.WebSocket();
ws.PongAutoConsume = true;
Chilkat.Rest rest = new Chilkat.Rest();
bool success = rest.Connect("localhost", 8080, false, false);
ws.UseConnection(rest);
ws.AddClientHeaders();
string responseBodyIgnored = rest.FullRequestNoBody("GET", "/wsChilkatEcho.ashx");
success = ws.ValidateServerHandshake();
if (success != true)
{
Console.WriteLine(ws.LastErrorText);
return;
}
bool finalFrame = false;
success = ws.SendFrame("This is the 1st frame\r\n", finalFrame);
if (success != true)
{
Console.WriteLine(ws.LastErrorText);
return;
}
// Let's send a Ping frame here...
success = ws.SendPing("This is a ping");
if (success != true)
{
Console.WriteLine(ws.LastErrorText);
return;
}