Spring Boot
netty-socket-io.hostname=localhost
netty-socket-io.port=9092
netty-socket-io.ping-timeout=60000
netty-socket-io.ping-interval=25000netty-socket-io:
hostname: localhost
port: 9092
ping-timeout: 60000
ping-interval: 25000
自定义 SocketIOServer Bean
@Configuration
public class SocketIOConfig {
@Bean
public SocketIOServer socketIOServer() {
Configuration config = new Configuration();
config.setHostname("localhost");
config.setPort(9092);
return new SocketIOServer(config);
}
}主应用程序
使用注解的事件处理器
异常处理
完整示例
最后更新于
这有帮助吗?