Skip to content

Commit 1320fed

Browse files
committed
Use WebsocketOutbound#sendClose
Switch to using the sendClose method available since Reactor Netty 0.8 vs explicitly sending a CloseWebSocketFrame. Related to SPR-17306, but does not address the root cause.
1 parent e63bffc commit 1320fed

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/ReactorNettyWebSocketSession.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
package org.springframework.web.reactive.socket.adapter;
1717

18-
import io.netty.handler.codec.http.websocketx.CloseWebSocketFrame;
1918
import io.netty.handler.codec.http.websocketx.WebSocketFrame;
2019
import org.reactivestreams.Publisher;
2120
import reactor.core.publisher.Flux;
@@ -98,8 +97,7 @@ public Mono<Void> send(Publisher<WebSocketMessage> messages) {
9897

9998
@Override
10099
public Mono<Void> close(CloseStatus status) {
101-
WebSocketFrame closeFrame = new CloseWebSocketFrame(status.getCode(), status.getReason());
102-
return getDelegate().getOutbound().sendObject(closeFrame).then();
100+
return getDelegate().getOutbound().sendClose(status.getCode(), status.getReason());
103101
}
104102

105103

0 commit comments

Comments
 (0)