Skip to content

Commit

Permalink
Merge pull request googollee#59 from erkie/master
Browse files Browse the repository at this point in the history
Set state of closing before closing the socket
  • Loading branch information
erkie committed Jun 11, 2018
2 parents 80ae0e4 + 3709370 commit d52cf42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion polling/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ func (p *Polling) Close() error {
if p.getState() != stateNormal {
return nil
}
close(p.sendChan)
p.setState(stateClosing)
close(p.sendChan)
if p.getLocker.TryLock() {
if p.postLocker.TryLock() {
p.callback.OnClose(p)
Expand Down

0 comments on commit d52cf42

Please sign in to comment.