mirror of
https://github.com/kataras/iris.git
synced 2026-01-09 04:51:56 +00:00
fix websocket some times tries to emit to a disconnected client
Former-commit-id: 026798e6bc587c902bfc9f92281aced406d628a5
This commit is contained in:
@@ -34,6 +34,10 @@ func (e *emitter) EmitMessage(nativeMessage []byte) error {
|
||||
}
|
||||
|
||||
func (e *emitter) Emit(event string, data interface{}) error {
|
||||
if e.conn.server.rooms[e.to] == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
message, err := websocketMessageSerialize(event, data)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user