minor improvements
authorBernhard Tittelbach <xro@realraum.at>
Wed, 25 Sep 2013 01:10:03 +0000 (01:10 +0000)
committerBernhard Tittelbach <xro@realraum.at>
Wed, 25 Sep 2013 01:10:03 +0000 (01:10 +0000)
go/door_client_zmq/main.go
go/door_client_zmq/make_deploy.zsh [new file with mode: 0644]
go/door_client_zmq/zeromq.go

index a49fb88..60f2fc9 100644 (file)
@@ -25,8 +25,8 @@ func usage() {
 }
 
 func init() {
-    flag.StringVar(&cmd_port_, "cmdport", "tcp://127.0.0.1:3232", "zmq command socket path")
-    flag.StringVar(&sub_port_, "pubport", "pgm://233.252.1.42:4242", "zmq subscribe/listen socket path")
+    flag.StringVar(&cmd_port_, "cmdport", "ipc:///run/tuer/door_cmd.ipc", "zmq command socket path")
+    flag.StringVar(&sub_port_, "pubport", "tcp://torwaechter.realraum.at:4242", "zmq subscribe/listen socket path")
     flag.Usage = usage
     flag.Parse()
 }
@@ -87,14 +87,13 @@ func main() {
                 os.Exit(0)
             }
         case pubsubstuff := <- sub_chans.In():
-            log.Print("pubsubstuff",pubsubstuff)
             if len(pubsubstuff) == 0 { continue}
             if ignore_next {
                 ignore_next = false
                 continue
             }
             if listen {
-                fmt.Println(pubsubstuff)
+                fmt.Println(ByteArrayToString(pubsubstuff))
             }
         }
     }
diff --git a/go/door_client_zmq/make_deploy.zsh b/go/door_client_zmq/make_deploy.zsh
new file mode 100644 (file)
index 0000000..746215b
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/zsh
+export GO386=387
+export CGO_ENABLED=1
+go-linux-386 clean
+#go-linux-386 build
+#strip ${PWD:t}
+go-linux-386 build -ldflags "-s" && rsync -v ${PWD:t} wuzzler.realraum.at:/flash/tuer/
index abf17b2..cde60c9 100644 (file)
@@ -45,11 +45,7 @@ func ZmqsInit(cmd_port, sub_port string)  (ctx *zmq.Context, cmd_chans, sub_chan
         }
         defer func() { if r:= recover(); r != nil { sub_sock.Close(); panic(r) } }()
 
-        sub_sock.Subscribe([]byte("close"))
-        sub_sock.Subscribe([]byte("toggle"))
-        sub_sock.Subscribe([]byte("Info"))
-        sub_sock.Subscribe([]byte("State"))
-        sub_sock.Subscribe([]byte("open"))
+        sub_sock.Subscribe([]byte{}) //subscribe empty filter -> aka to all messages
 
         if err = sub_sock.Connect(sub_port); err != nil {
             panic(err)