listeners.go raw

   1  package util
   2  
   3  import (
   4  	"net"
   5  	"strconv"
   6  )
   7  
   8  func GetActualPort(listener string) uint16 {
   9  	var e error
  10  	var p string
  11  	if _, p, e = net.SplitHostPort(listener); E.Chk(e) {
  12  	}
  13  	var oI uint64
  14  	if oI, e = strconv.ParseUint(p, 10, 16); E.Chk(e) {
  15  	}
  16  	return uint16(oI)
  17  }
  18