(conn *websocket.Conn, mt int, message []byte)
| 43 | } |
| 44 | |
| 45 | func safeWriteMessage(conn *websocket.Conn, mt int, message []byte) error { |
| 46 | connMutexesMu.RLock() |
| 47 | mutex, exists := connMutexes[conn] |
| 48 | connMutexesMu.RUnlock() |
| 49 | |
| 50 | if !exists { |
| 51 | return nil |
| 52 | } |
| 53 | |
| 54 | mutex.Lock() |
| 55 | defer mutex.Unlock() |
| 56 | return conn.WriteMessage(mt, message) |
| 57 | } |
| 58 | |
| 59 | func SendToAllExclude(path string, mt int, message []byte, exclude *websocket.Conn) { |
| 60 | clientsMu.RLock() |
no outgoing calls
no test coverage detected