'ASP.Net WebSocket how to simulate error event?

I just want to do like this on ASP.NET WebSocket.

When my WebSocket server catches internal server error, I want my WebSocket server to send an error to clients. Then I want my client to catch an error on OnError callback.

Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source