修改端口绑定错误提示

This commit is contained in:
imhao183
2021-04-12 09:56:08 +08:00
parent 499ee713d6
commit bc25587461
4 changed files with 9 additions and 10 deletions
@@ -150,8 +150,8 @@ public class NettyAcceptor implements ServerAcceptor {
LOG.error("An interruptedException was caught while initializing server. Protocol={}", protocol, ex);
} catch (Exception e) {
e.printStackTrace();
LOG.error("端口 {} 已经被占用。请检查该端口被那个程序占用,找到程序停掉。\n查找端口被那个程序占用的命令是: netstat -tunlp | grep {}", port, port);
System.out.println("端口 " + port + " 已经被占用。请检查该端口被那个程序占用,找到程序停掉。\n查找端口被那个程序占用的命令是: netstat -tunlp | grep " + port);
LOG.error("端口 {} 已经被占用或者无权限使用。如果无权限使用,请以root权限运行;如果被占用,请检查该端口被那个程序占用,找到程序停掉。\n查找端口被那个程序占用的命令是: netstat -tunlp | grep {}", port, port);
System.out.println("端口 " + port + " 已经被占用或者无权限使用。如果无权限使用,请以root权限运行;如果被占用,请检查该端口被那个程序占用,找到程序停掉。\n查找端口被那个程序占用的命令是: netstat -tunlp | grep " + port);
System.exit(-1);
}
}