func (agent *agent_t) control_message() (err error) {
	msg, e := agent.pipe.RecvMessage(0)
	if e != nil {
		return e
	}
	command := msg[0]
	switch command {
	case "EXAMPLE":
	default:
	}
	return
}
Here we handle the different control messages from the front-end.
package intface
import (
	zmq "github.com/pebbe/zmq4"
	"github.com/google/uuid"
	"bytes"
	"errors"
	"net"
	"time"
)
type Intface struct {
	pipe *zmq.Socket  
}
func New() (iface *Intface) {
	iface = &Intface{}
	var err error
	iface.pipe, err = zmq.NewSocket(zmq.PAIR)
	if err != nil {
		panic(err)
	}
	err = iface.pipe.Bind("inproc://iface")
	if err != nil {
		panic(err)
	}
	go iface.agent()
	time.Sleep(100 * time.Millisecond)
	return
}
func (iface *Intface) Recv() (msg []string, err error) {
	msg, err = iface.pipe.RecvMessage(0)
	return
}
type peer_t struct {
	uuid_bytes  []byte
	uuid_string string
	expires_at  time.Time
}
const (
	PING_PORT_NUMBER = 9999
	PING_INTERVAL    = 1000 * time.Millisecond  
	PEER_EXPIRY      = 5000 * time.Millisecond  
)
func new_peer(uuid uuid.UUID) (peer *peer_t) {
	uuid_bytes, _ := uuid.MarshalBinary()
	peer = &peer_t{
		uuid_bytes:  uuid_bytes,
		uuid_string: uuid.String(),
	}
	return
}
func (peer *peer_t) is_alive() {
	peer.expires_at = time.Now().Add(PEER_EXPIRY)
}
type agent_t struct {
	pipe        *zmq.Socket  
	udp         *zmq.Socket
	conn        *net.UDPConn
	uuid_bytes  []byte  
	uuid_string string
	peers       map[string]*peer_t  
}
func new_agent() (agent *agent_t) {
	addr := &net.UDPAddr{Port: PING_PORT_NUMBER, IP: net.IPv4allsys}
	conn, e := net.ListenMulticastUDP("udp", nil, addr)
	if e != nil {
		panic(e)
	}
	go func() {
		buffer := make([]byte, 1024)
		udp, _ := zmq.NewSocket(zmq.PAIR)
		udp.Bind("inproc://udp")
		for {
			if n, _, err := conn.ReadFrom(buffer); err == nil {
				udp.SendBytes(buffer[:n], 0)
			}
		}
	}()
	time.Sleep(100 * time.Millisecond)
	pipe, _ := zmq.NewSocket(zmq.PAIR)
	pipe.Connect("inproc://iface")
	udp, _ := zmq.NewSocket(zmq.PAIR)
	udp.Connect("inproc://udp")
	uuID := uuid.New()
	uuid_bytes, _ := uuID.MarshalBinary()
	agent = &agent_t{
		pipe:        pipe,
		udp:         udp,
		conn:        conn,
		uuid_bytes:  uuid_bytes,
		uuid_string: uuID.String(),
		peers:       make(map[string]*peer_t),
	}
	pipe.SendMessage("AGENT ", uuID.String())
	return
}