@@ -219,25 +219,25 @@ public void onMessage(okhttp3.WebSocket webSocket, ByteString bytes) {
219219 }
220220
221221 @ Override
222- public void onClosing (okhttp3 .WebSocket webSocket , int code , String reason ) {
222+ public void onClosing (okhttp3 .WebSocket ws , int code , String reason ) {
223223 this .webSocket .setStatus (WebSocket .STATUS_DISCONNECTED );
224224 Listener <Close > listener = onClosing ;
225225 if (listener != null ) {
226226 execute (() -> listener .on (this .webSocket , new Close (code , reason )), closingOnIO );
227227 }
228228 httpClient .executor ().requireScheduler ().schedule (() -> {
229- doOnClose (webSocket , HttpResult .State .RESPONSED , code , reason );
229+ doOnClose (HttpResult .State .RESPONSED , code , reason );
230230 }, maxClosingSecs , TimeUnit .SECONDS );
231231 }
232232
233233 @ Override
234- public void onClosed (okhttp3 .WebSocket webSocket , int code , String reason ) {
235- doOnClose (webSocket , HttpResult .State .RESPONSED , code , reason );
234+ public void onClosed (okhttp3 .WebSocket ws , int code , String reason ) {
235+ doOnClose (HttpResult .State .RESPONSED , code , reason );
236236 }
237237
238- private void doOnClose (okhttp3 . WebSocket webSocket , HttpResult .State state , int code , String reason ) {
238+ private void doOnClose (HttpResult .State state , int code , String reason ) {
239239 synchronized (WHttpTask .this ) {
240- if (WHttpTask .this .webSocket == null || this .webSocket . webSocket != webSocket ) {
240+ if (WHttpTask .this .webSocket == null || this .webSocket != WHttpTask . this . webSocket ) {
241241 return ; // 回调已经执行过
242242 }
243243 WHttpTask .this .webSocket = null ;
@@ -276,9 +276,11 @@ private Close updateStatus(HttpResult.State state, int code, String reason) {
276276 }
277277
278278 @ Override
279- public void onFailure (okhttp3 .WebSocket webSocket , Throwable t , Response response ) {
279+ public void onFailure (okhttp3 .WebSocket ws , Throwable t , Response response ) {
280280 IOException e = t instanceof IOException ? (IOException ) t : new IOException (t .getMessage (), t );
281- doOnClose (webSocket , toState (e ), 0 , t .getMessage ());
281+ doOnClose (toState (e ), 0 , t .getMessage ());
282+
283+
282284 TaskListener <IOException > listener = httpClient .executor ().getExceptionListener ();
283285 Listener <Throwable > exceptionListener = onException ;
284286 if (listener != null ) {
0 commit comments