HandleMessage fires fn when a text message comes in. NOTE: by default Melody handles messages sequentially for each session. This has the effect that a message handler exceeding the read deadline (Config.PongWait, by default 1 minute) will time out the session. Concurrent message handling can be tur
(fn func(*Session, []byte))
| 94 | // the session. Concurrent message handling can be turned on by setting |
| 95 | // Config.ConcurrentMessageHandling to true. |
| 96 | func (m *Melody) HandleMessage(fn func(*Session, []byte)) { |
| 97 | m.messageHandler = fn |
| 98 | } |
| 99 | |
| 100 | // HandleMessageBinary fires fn when a binary message comes in. |
| 101 | func (m *Melody) HandleMessageBinary(fn func(*Session, []byte)) { |
no outgoing calls