Updates return value for Websocket return.
From @rstoyanchev: I think serverClose and proxyClose don't need to be included in, and probably should be separated from the zip because they are sort of competing with the Mono<Void> from each WebSocketHandler, and zip will cancel the other publishers after one of them completes.
This commit is contained in:
@@ -214,8 +214,10 @@ public class WebsocketRoutingFilter implements GlobalFilter, Ordered {
|
||||
Mono<Void> serverSessionSend = session
|
||||
.send(proxySession.receive().doOnNext(WebSocketMessage::retain));
|
||||
// .log("sessionSend", Level.FINE);
|
||||
return Mono.zip(proxySessionSend, serverSessionSend, serverClose, proxyClose).then();
|
||||
}
|
||||
// Ensure closeStatus from one propagates to the other
|
||||
Mono.when(serverClose, proxyClose).subscribe();
|
||||
// Complete when both sessions are done
|
||||
return Mono.zip(proxySessionSend, serverSessionSend).then(); }
|
||||
|
||||
/**
|
||||
* Copy subProtocols so they are available downstream.
|
||||
|
||||
Reference in New Issue
Block a user