summaryrefslogtreecommitdiffstats
path: root/cmd/daemon/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/daemon/main.go')
-rw-r--r--cmd/daemon/main.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/cmd/daemon/main.go b/cmd/daemon/main.go
index 56b7c16..aa142d9 100644
--- a/cmd/daemon/main.go
+++ b/cmd/daemon/main.go
@@ -14,7 +14,7 @@ import (
var (
cmds = map[string]func(args []string){
- "ping": sendPing,
+ "broadcast": sendBroadcast,
}
serv = server.NewServer("localhost:9999")
@@ -24,10 +24,11 @@ func main() {
fmt.Println("SOLEC MOCK SERVER")
fmt.Println("Commands:", slices.Sorted(maps.Keys(cmds)))
+ go readCmds()
+
if err := serv.Start(); err != nil {
panic(err)
}
- readCmds()
}
func readCmds() {
@@ -48,6 +49,7 @@ func readCmds() {
}
}
-func sendPing(args []string) {
-
+func sendBroadcast(args []string) {
+ msg := strings.Join(args[0:], " ")
+ serv.SendBroadcast(msg)
}