support udp

This commit is contained in:
fatedier
2017-03-13 02:44:47 +08:00
parent a1023fdfc2
commit 54bbfe26b0
10 changed files with 378 additions and 155 deletions

View File

@@ -131,7 +131,7 @@ func (ctl *Control) GetWorkConn() (workConn net.Conn, err error) {
select {
case workConn, ok = <-ctl.workConnCh:
if !ok {
err = fmt.Errorf("no work connections available, control is closing")
err = errors.ErrCtlClosed
return
}
ctl.conn.Debug("get work connection from pool")
@@ -148,8 +148,8 @@ func (ctl *Control) GetWorkConn() (workConn net.Conn, err error) {
select {
case workConn, ok = <-ctl.workConnCh:
if !ok {
err = fmt.Errorf("no work connections available, control is closing")
ctl.conn.Warn("%v", err)
err = errors.ErrCtlClosed
ctl.conn.Warn("no work connections avaiable, %v", err)
return
}
@@ -251,8 +251,8 @@ func (ctl *Control) stoper() {
}
for _, pxy := range ctl.proxies {
ctl.svr.DelProxy(pxy.GetName())
pxy.Close()
ctl.svr.DelProxy(pxy.GetName())
}
ctl.allShutdown.Done()