This commit is contained in:
2020-02-23 13:06:35 +08:00
parent 0a2f104ee6
commit 81be6741b4

View File

@@ -86,7 +86,7 @@ func handleTcpRequest(tcpListen TcpListen, sconn net.Conn) {
fmt.Printf("[WARN] Send data to %v failed:%v\n", ip, err)
}
}
ExitChan <- true
Exit <- true
}(sconn, dconn, ExitChan)
go func(sconn net.Conn, dconn net.Conn, Exit chan bool) {
_, err := io.Copy(sconn, dconn)
@@ -98,7 +98,7 @@ func handleTcpRequest(tcpListen TcpListen, sconn net.Conn) {
fmt.Printf("[WARN] Receive data from %v failed:%v\n", ip, err)
}
}
ExitChan <- true
Exit <- true
}(sconn, dconn, ExitChan)
<-ExitChan
dconn.Close()