(message envelope)
| 22 | } |
| 23 | |
| 24 | func (s *Session) writeMessage(message envelope) { |
| 25 | if s.closed() { |
| 26 | s.melody.errorHandler(s, ErrWriteClosed) |
| 27 | return |
| 28 | } |
| 29 | |
| 30 | select { |
| 31 | case s.output <- message: |
| 32 | default: |
| 33 | s.melody.errorHandler(s, ErrMessageBufferFull) |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | func (s *Session) writeRaw(message envelope) error { |
| 38 | if s.closed() { |