From 12108d50886717b2f58e3c1f4be52b078c790449 Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Wed, 25 Sep 2013 01:10:03 +0000 Subject: [PATCH] minor improvements --- go/door_client_zmq/main.go | 7 +++---- go/door_client_zmq/make_deploy.zsh | 7 +++++++ go/door_client_zmq/zeromq.go | 6 +----- 3 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 go/door_client_zmq/make_deploy.zsh diff --git a/go/door_client_zmq/main.go b/go/door_client_zmq/main.go index a49fb88..60f2fc9 100644 --- a/go/door_client_zmq/main.go +++ b/go/door_client_zmq/main.go @@ -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 index 0000000..746215b --- /dev/null +++ b/go/door_client_zmq/make_deploy.zsh @@ -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/ diff --git a/go/door_client_zmq/zeromq.go b/go/door_client_zmq/zeromq.go index abf17b2..cde60c9 100644 --- a/go/door_client_zmq/zeromq.go +++ b/go/door_client_zmq/zeromq.go @@ -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) -- 1.7.10.4