WebSocket keeps disconnecting between several time interval
<p>we are being using web socket for the live communication between server and android app. But the main problem here is the web socket keeps disconnecting in several time intervals and we are not able to set the socket time out in both the sides. Any how many questions are asked on this topic but the results were not helpful to us.</p>

<p>Server : for server we are using .net and the sample is taken from <a href="https://github.com/paulbatum/WebSocket-Samples" rel="nofollow">https://github.com/paulbatum/WebSocket-Samples</a> under that we took AspNetChat folder and developed socket server from that</p>

<p>Android Client : the sample is taken from java-websocket-1.3.0 and the code in the android is written in the way that if the socket is disconnected it will automatically reconnect.</p>

<p>The major issue we are facing are after some time interval say some 30min the websocket connection between the server and the client is not working. We were not able to say even if it is disconnected or not but when sending message from android the log says that it is connected to the server and the server doesn't receive the message in the onMessage function.</p>

<p>If there is a solution to this this would be more helpful and if there is any other alternate protocol we can check that also.</p>

<p>Thanks in advance</p>