Converting client side connection over to use net/http instead of zmq.

This commit is contained in:
James Wells 2021-10-15 11:27:38 -07:00
parent f543276b82
commit 16d40fd93a
Signed by: jwells
GPG key ID: 73196D10B8E65666
5 changed files with 52 additions and 53 deletions

View file

@ -3,6 +3,7 @@ package worker
import (
fmt "fmt"
log "log"
http "net/http"
sync "sync"
gs "git.dragonheim.net/dragonheim/gagent/internal/gstructs"
@ -26,6 +27,10 @@ func Main(wg *sync.WaitGroup, config gs.GagentConfig, rid int) {
subscriber, _ := zmq.NewSocket(zmq.REP)
defer subscriber.Close()
go func() {
http.ListenAndServe(fmt.Sprintf("%s:%d", config.ListenAddr, config.ClientPort), nil)
}()
log.Printf("[DEBUG] Attempting to connect to %s\n", connectString)
subscriber.Connect(connectString)