ing
This commit is contained in:
parent
3b3f53cfa2
commit
3a437b10a4
|
@ -126,15 +126,15 @@ func handleConnection(s *server, conn net.Conn) {
|
|||
|
||||
logging.Logger.Debug(fmt.Sprintf("Server: Client[%s] is connected.", conn.RemoteAddr()))
|
||||
clientStopChan := make(chan struct{})
|
||||
handleDoneCnah := make(chan struct{})
|
||||
go s.sh.Handle(conn, clientStopChan, handleDoneCnah)
|
||||
handleDoneChan := make(chan struct{})
|
||||
go s.sh.Handle(conn, clientStopChan, handleDoneChan)
|
||||
|
||||
select {
|
||||
case <-s.stopChan:
|
||||
close(clientStopChan)
|
||||
conn.Close()
|
||||
<-handleDoneCnah
|
||||
case <-handleDoneCnah:
|
||||
<-handleDoneChan
|
||||
case <-handleDoneChan:
|
||||
close(clientStopChan)
|
||||
conn.Close()
|
||||
logging.Logger.Debug(fmt.Sprintf("Server: Client[%s] is disconnected.", conn.RemoteAddr()))
|
||||
|
|
Loading…
Reference in New Issue
Block a user