// Echo service func echo(socket *zmq.Socket) (err error) { msg, err := socket.RecvMessage(0) if err != nil { return } _, err = socket.SendMessage(msg) return }
// Send key-value message to socket; any empty frames are sent as such. func (kvmsg *Kvmsg) Send(socket *zmq.Socket) (err error) { //fmt.Printf("Send to %s: %q\n", socket, kvmsg.frame) kvmsg.encode_props() _, err = socket.SendMessage(kvmsg.frame) return }
func (server *server_t) ping(socket *zmq.Socket) { if time.Now().After(server.ping_at) { socket.SendMessage(server.endpoint, "PING") server.ping_at = time.Now().Add(PING_INTERVAL) } }