MCPcopy Create free account
hub / github.com/MertJSX/folderhost / safeWriteMessage

Function safeWriteMessage

utils/web_socket_clients.go:45–57  ·  view source on GitHub ↗
(conn *websocket.Conn, mt int, message []byte)

Source from the content-addressed store, hash-verified

43}
44
45func 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
59func SendToAllExclude(path string, mt int, message []byte, exclude *websocket.Conn) {
60 clientsMu.RLock()

Callers 2

SendToAllExcludeFunction · 0.85
SendToAllFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected