Commit 10cff3cf authored by Tiago Cunha's avatar Tiago Cunha

WebSocket

parent aede4750
...@@ -29,28 +29,28 @@ public class RxWebSocket { ...@@ -29,28 +29,28 @@ public class RxWebSocket {
(FlowableOnSubscribe<RxWebSocketCallback.Base>) emitter -> httpClient (FlowableOnSubscribe<RxWebSocketCallback.Base>) emitter -> httpClient
.newWebSocket(request, new WebSocketListener() { .newWebSocket(request, new WebSocketListener() {
@Override @Override
public void onOpen(WebSocket webSocket1, Response response) { public void onOpen(WebSocket webSocket, Response response) {
RxWebSocket.this.webSocket = webSocket1; RxWebSocket.this.webSocket = webSocket;
emitter.onNext(new RxWebSocketCallback.Open(RxWebSocket.this.webSocket, response)); emitter.onNext(new RxWebSocketCallback.Open(RxWebSocket.this.webSocket, response));
} }
@Override @Override
public void onFailure(WebSocket webSocket1, Throwable err, Response response) { public void onFailure(WebSocket webSocket, Throwable err, Response response) {
try { try {
emitter.onError(new RxWebSocketCallback.Failure(webSocket1, err, response)); emitter.onError(new RxWebSocketCallback.Failure(webSocket, err, response));
} catch (OnErrorNotImplementedException ex) { } catch (OnErrorNotImplementedException ex) {
RCLog.w(ex, "OnErrorNotImplementedException ignored"); RCLog.w(ex, "OnErrorNotImplementedException ignored");
} }
} }
@Override @Override
public void onMessage(WebSocket webSocket1, String text) { public void onMessage(WebSocket webSocket, String text) {
emitter.onNext(new RxWebSocketCallback.Message(webSocket1, text)); emitter.onNext(new RxWebSocketCallback.Message(webSocket, text));
} }
@Override @Override
public void onClosed(WebSocket webSocket1, int code, String reason) { public void onClosed(WebSocket webSocket, int code, String reason) {
emitter.onNext(new RxWebSocketCallback.Close(webSocket1, code, reason)); emitter.onNext(new RxWebSocketCallback.Close(webSocket, code, reason));
emitter.onComplete(); emitter.onComplete();
} }
}), }),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment