Browse Source

fix documentation

master
Ola Holmström 10 years ago
parent
commit
aedcbc9362
  1. 2
      melody.go
  2. 4
      session.go

2
melody.go

@ -58,7 +58,7 @@ func (m *Melody) HandleMessage(fn func(*Session, []byte)) {
}
// Fires when a session has an error.
func (m *Melody) HandleError(fn handleErrorFunc) {
func (m *Melody) HandleError(fn func(*Session, error)) {
m.errorHandler = fn
}

4
session.go

@ -83,12 +83,12 @@ func (s *Session) readPump(messageHandler handleMessageFunc, errorHandler handle
}
}
// Write a message to session.
// Write message to session.
func (s *Session) Write(msg []byte) {
s.writeMessage(&envelope{t: websocket.TextMessage, msg: msg})
}
// Close a session.
// Close session.
func (s *Session) Close() {
s.writeMessage(&envelope{t: websocket.CloseMessage, msg: []byte{}})
}
Loading…
Cancel
Save