asp.net websocket connection reset by peer

I’m working with web socket in asp.net mvc and created a websocket handler to handle websocket requests the problem is when a client(android app) connects to server using websocket after a few sec(i think 30 sec) the connection is closed, and in android studio i got this error

java.net.SocketException: sendto failed: ECONNRESET (Connection reset by peer) 

i have searched and tried some of solutions but cannot to solve it

this is my websocket handler test.ashx in asp.net mvc web application:

 public class WSHttpHandler : IHttpHandler {      public void ProcessRequest(HttpContext context)      {         try         {             if (context.IsWebSocketRequest)             {                 context.AcceptWebSocketRequest(new TestWebSocketHandler());              }          }         catch (Exception ex)         {             // log exception         }     }  } 

and TestWebSocketHandler.cs:

 public class TestWebSocketHandler : WebSocketHandler  {       public override void OnOpen()      {      }       public override void OnMessage(string message)     {      }       public override void OnClose()      {      }  }