1
0
mirror of https://github.com/chatopera/cosin.git synced 2025-07-20 04:23:01 +08:00

Merge pull request #666 from zc1813400107/issue662

解决netty端口重启被占用问题
This commit is contained in:
Hai Liang W 2022-03-28 09:43:36 +08:00 committed by GitHub
commit e4b7d94be7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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);