客户端断线重连bug修复

This commit is contained in:
刘河
2018-12-06 20:45:14 +08:00
parent e6c2de7d9f
commit c35ce71e7c
6 changed files with 45 additions and 21 deletions

5
udp.go
View File

@@ -56,7 +56,10 @@ func (s *UdpModeServer) startTunnelServer() {
func (s *UdpModeServer) process(addr *net.UDPAddr, data []byte) {
conn := s.GetTunnel()
conn.WriteHost("udp", s.tunnelTarget)
if _, err := conn.WriteHost(CONN_UDP, s.tunnelTarget);err!=nil{
conn.Close()
return
}
go func() {
for {
buf := make([]byte, 1024)