protected override void OnMessageReceived(IWebSocketContext context, byte[] buffer, IWebSocketReceiveResult result)
 {
     // 0 = Text message
     // 1 = Binary message
     // 2 = Close
     if (result.MessageType == 0)
     {
         ServerMain.ReceivedMessage(context, Encoding.UTF8.GetString(buffer));
     }
 }
 protected override void OnClientDisconnected(IWebSocketContext context)
 {
     ServerMain.RemoveClient(context);
 }
 protected override void OnClientConnected(IWebSocketContext context, IPEndPoint localEndPoint, IPEndPoint remoteEndPoint)
 {
     ServerMain.NewClient(context);
 }