bhandarkar_amey
Lurker
I am working on an android application which has a client-server architecture. I am creating a WebSocketClient to connect to a server. Every thing works fine till I keep the device idle for sometime. When the device is kept idle for sometime, I connection with the server closes for some reason. I am not using java_websocket.jar for this.
Refer to the following code :
WebSocketClient client =newWebSocketClient(new URI(path), draft){
@Overridepublicvoid onMessage(String message){
// some code here
}
@Overridepublicvoid onOpen(ServerHandshake handshake){
// Some code here
}
@Overridepublicvoid onError(Exception ex){
// Some code here
}};
client.connect();
I would appreciate if someone would help me as I am not able to resolve this issue since many days.
Refer to the following code :
WebSocketClient client =newWebSocketClient(new URI(path), draft){
@Overridepublicvoid onMessage(String message){
// some code here
}
@Overridepublicvoid onOpen(ServerHandshake handshake){
// Some code here
}
@Overridepublicvoid onError(Exception ex){
// Some code here
}};
client.connect();
I would appreciate if someone would help me as I am not able to resolve this issue since many days.
Last edited: