1
0
mirror of https://github.com/chatopera/cosin.git synced 2025-07-11 20:17:03 +08:00

解决netty端口重启被占用问题

This commit is contained in:
zhouchuan 2022-03-27 14:13:11 +08:00
parent 0a2c517b2d
commit f60de23b5e

View File

@ -66,6 +66,11 @@ public class MessagingServerConfigure {
@Bean
public SocketIOServer socketIOServer() throws NoSuchAlgorithmException, IOException {
Configuration config = new Configuration();
//解决对此重启服务时netty端口被占用问题
com.corundumstudio.socketio.SocketConfig tmpConfig = new com.corundumstudio.socketio.SocketConfig();
tmpConfig.setReuseAddress(true);
config.setSocketConfig(tmpConfig);
// config.setHostname("localhost");
config.setPort(port);