Add closeHandler support

This commit is contained in:
Robbie Trencheny
2017-03-28 14:00:51 -07:00
parent c773bc2f72
commit 9a70fe93ac
2 changed files with 47 additions and 0 deletions
+5
View File
@@ -115,6 +115,11 @@ func (s *Session) readPump() {
return nil
})
s.conn.SetCloseHandler(func(code int, text string) error {
s.melody.closeHandler(s, code, text)
return nil
})
for {
t, message, err := s.conn.ReadMessage()