Skip to content

Commit

Permalink
close method
Browse files Browse the repository at this point in the history
  • Loading branch information
sdfsdhgjkbmnmxc committed Sep 25, 2020
1 parent 4827218 commit 7af264b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ws.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ func (w *WsSession) Send(event tdproto.Event) string {
return event.GetConfirmId()
}

func (w *WsSession) Close() error {
w.closed = true
return w.conn.Close()
}

func (w *WsSession) outboxLoop() {
for !w.closed {
event := <-w.outbox
Expand Down

0 comments on commit 7af264b

Please sign in to comment.