Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when disconnecting from websocket server, CloseWebSocketFrame does not reach client #332

Closed
myninjagos opened this issue Apr 23, 2018 · 0 comments
Labels
type/bug A general bug
Milestone

Comments

@myninjagos
Copy link

Hi,

i am using google's smart websocket client to test my websocket server.
after connecting and pressing the button 'disconnect', i would expect that this button should turn into 'connect'. instead, it still shows 'disconnect'.
from logs, it seems that CloseWebSocketFrame bytes are never reach the client.

my configuration

	@Bean
	public HandlerMapping webSocketMapping() {
		Map<String, WebSocketHandler> map = new HashMap<>();
		map.put("/wsticker", (session) -> 
			session.send(
				session.receive()
					.map(WebSocketMessage::retain)));

		SimpleUrlHandlerMapping mapping = new SimpleUrlHandlerMapping();
		mapping.setUrlMap(map);
		mapping.setOrder(10);
		
		return mapping;
	}

	@Bean
	public WebSocketHandlerAdapter handlerAdapter() {
		return new WebSocketHandlerAdapter();
	}

logs

2018-04-23 17:43:53.001 [reactor-http-nio-2] DEBUG reactor.ipc.netty.http.server.HttpServer -  - [id: 0x06164d82, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:57285] READ: 6B
         +-------------------------------------------------+
         |  0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f |
+--------+-------------------------------------------------+----------------+
|00000000| 88 80 44 71 b7 55                               |..Dq.U          |
+--------+-------------------------------------------------+----------------+
2018-04-23 17:43:53.002 [reactor-http-nio-2] DEBUG io.netty.handler.codec.http.websocketx.WebSocket08FrameDecoder -  - Decoding WebSocket Frame opCode=8
2018-04-23 17:43:53.002 [reactor-http-nio-2] DEBUG io.netty.handler.codec.http.websocketx.WebSocket08FrameDecoder -  - Decoding WebSocket Frame length=0
2018-04-23 17:43:53.003 [reactor-http-nio-2] DEBUG reactor.ipc.netty.http.server.HttpServerOperations -  - CloseWebSocketFrame detected. Closing Websocket
2018-04-23 17:43:55.745 [reactor-http-nio-2] DEBUG reactor.ipc.netty.channel.ChannelOperationsHandler -  - [id: 0x06164d82, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:57285] Writing object CloseWebSocketFrame(data: PooledUnsafeDirectByteBuf(ridx: 0, widx: 0, cap: 0))
2018-04-23 17:43:55.745 [reactor-http-nio-2] DEBUG reactor.ipc.netty.http.server.HttpServer -  - [id: 0x06164d82, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:57285] READ COMPLETE

thanks
B.

@violetagg violetagg added this to the 0.7.7.RELEASE milestone Apr 24, 2018
@violetagg violetagg added the type/bug A general bug label Apr 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants