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

Function SendToAll

utils/web_socket_clients.go:70–85  ·  view source on GitHub ↗
(path string, mt int, message []byte)

Source from the content-addressed store, hash-verified

68}
69
70func SendToAll(path string, mt int, message []byte) {
71 clientsMu.RLock()
72 defer clientsMu.RUnlock()
73
74 var wg sync.WaitGroup
75 for conn, client := range clients {
76 if client.Path == path {
77 wg.Add(1)
78 go func(c *websocket.Conn) {
79 defer wg.Done()
80 safeWriteMessage(c, mt, message)
81 }(conn)
82 }
83 }
84 wg.Wait()
85}
86
87func GetClientsCount(path string) int {
88 clientsMu.RLock()

Callers 5

NewServiceLogFunction · 0.92
updateClientsCountFunction · 0.92
sendFullContentFunction · 0.92
sendReloadNotificationFunction · 0.92

Calls 1

safeWriteMessageFunction · 0.85

Tested by

no test coverage detected