24 lines
610 B
Java
24 lines
610 B
Java
package com.zhgd.xmgl.config;
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
import javax.websocket.ContainerProvider;
|
|
import javax.websocket.WebSocketContainer;
|
|
|
|
/**
|
|
* websocket配置
|
|
*/
|
|
@Configuration
|
|
public class WebSocketConfig {
|
|
/**
|
|
* 客户端配置/
|
|
*/
|
|
@Bean
|
|
public WebSocketContainer webSocketContainer() {
|
|
WebSocketContainer webSocketContainer = ContainerProvider.getWebSocketContainer();
|
|
webSocketContainer.setDefaultMaxSessionIdleTimeout(300000L);
|
|
return webSocketContainer;
|
|
}
|
|
}
|