-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Closed
Description
Hi, i have created a socket connection inside a service using:
OkHttpClient client = new OkHttpClient.Builder()
.readTimeout(3000, TimeUnit.MILLISECONDS)
.writeTimeout(3000, TimeUnit.MILLISECONDS)
.connectTimeout(3000, TimeUnit.MILLISECONDS)
.build();
Request request = new Request.Builder().addHeader(Config.WEBSOCKET_PARAM_COOKIE, "access_token=" + userToken)
.url(mySocketUrl)
.build();
webSocket = client.newWebSocket(request, websocketListener);
Everything works fine, but now i'm trying to simulate a no connection scenario. I have turned on the airplane mode, while in a chat, and tryied to send a message using .send(String). I through that it would fire some kind of exception or the onFailure/onClosed methods, but none of them are called. How can i detect if the .send function really worked? Thanks in advance.
umesh0492, ongakuer, th3hamm0r, hemantskycap and XJIOP
Metadata
Metadata
Assignees
Labels
No labels