This commit is contained in:
xdrm-brackets 2018-05-05 18:47:38 +02:00
parent dfeba31404
commit d03e08b466
1 changed files with 6 additions and 5 deletions

View File

@ -257,15 +257,16 @@ func (c *client) close(status MessageError, clientACK bool){
return
}
/* (2) kill reader if still running */
c.io.sock.SetReadDeadline(time.Now().Add(time.Second*-1))
c.io.reading.Wait()
/* (3) kill writer' if still running */
/* (2) kill writer' if still running */
if c.io.writing {
close(c.ch.send)
}
/* (3) kill reader if still running */
c.io.sock.SetReadDeadline(time.Now().Add(time.Second*-1))
c.io.reading.Wait()
if status == NONE {
status = NORMAL