update: support ipv6 (#2288)

This commit is contained in:
yuyulei
2021-03-10 20:19:58 +08:00
committed by GitHub
parent b5aee82ca9
commit 8e25f13201
7 changed files with 25 additions and 21 deletions

View File

@@ -27,8 +27,8 @@ type KCPListener struct {
closeFlag bool
}
func ListenKcp(bindAddr string, bindPort int) (l *KCPListener, err error) {
listener, err := kcp.ListenWithOptions(fmt.Sprintf("%s:%d", bindAddr, bindPort), nil, 10, 3)
func ListenKcp(address string) (l *KCPListener, err error) {
listener, err := kcp.ListenWithOptions(address, nil, 10, 3)
if err != nil {
return l, err
}