mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-04 06:54:45 +08:00
监听ip格式优化
This commit is contained in:
@@ -77,6 +77,14 @@ func (slf *CCluster) AcceptRpc(tpcListen *net.TCPListener) error {
|
||||
func (slf *CCluster) ListenService() error {
|
||||
|
||||
bindStr := slf.GetBindUrl()
|
||||
parts := strings.Split(bindStr, ":")
|
||||
if len(parts) < 2 {
|
||||
service.GetLogger().Printf(sysmodule.LEVER_FATAL, "ListenService address %s is error.", bindStr)
|
||||
os.Exit(1)
|
||||
}
|
||||
bindStr = "0.0.0.0:" + parts[1]
|
||||
|
||||
//
|
||||
tcpaddr, err := net.ResolveTCPAddr("tcp4", bindStr)
|
||||
if err != nil {
|
||||
service.GetLogger().Printf(sysmodule.LEVER_FATAL, "ResolveTCPAddr error:%v", err)
|
||||
|
||||
Reference in New Issue
Block a user