Switch roles of snake and echo

Snake is stateful so it should be one per connection. Echo is the
opposite.
This commit is contained in:
Dave Syer 2013-08-29 13:34:06 +01:00 committed by Phillip Webb
parent 347f30d135
commit 5755b07e6c
1 changed files with 2 additions and 2 deletions

View File

@ -55,12 +55,12 @@ public class SampleWebSocketsApplication extends SpringBootServletInitializer {
@Bean(name = "/echo")
public WebSocketHandler echoWebSocketHandler() {
return new PerConnectionWebSocketHandler(EchoWebSocketHandler.class);
return new EchoWebSocketHandler(echoService());
}
@Bean(name = "/snake")
public WebSocketHandler snakeWebSocketHandler() {
return new SnakeWebSocketHandler();
return new PerConnectionWebSocketHandler(SnakeWebSocketHandler.class);
}
}