new feature: assign a random port if remote_port is 0 in type tcp and

udp
This commit is contained in:
fatedier
2018-01-17 21:49:37 +08:00
parent 3f6799c06a
commit b2c846664d
21 changed files with 379 additions and 238 deletions

View File

@ -31,7 +31,7 @@ type KcpListener struct {
log.Logger
}
func ListenKcp(bindAddr string, bindPort int64) (l *KcpListener, err error) {
func ListenKcp(bindAddr string, bindPort int) (l *KcpListener, err error) {
listener, err := kcp.ListenWithOptions(fmt.Sprintf("%s:%d", bindAddr, bindPort), nil, 10, 3)
if err != nil {
return l, err