ready to do an event response

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-05-11 23:26:24 -07:00
parent 06e60fbcb6
commit 082e717d3d
2 changed files with 3 additions and 16 deletions

View File

@ -77,7 +77,7 @@ func gorillaDial() {
// handle inbound messages on the channel
go readGorillaConn(done, conn)
ticker := time.NewTicker(time.Second)
ticker := time.NewTicker(time.Second * 10)
defer ticker.Stop()
for {
@ -85,20 +85,7 @@ func gorillaDial() {
case <-done:
return
case t := <-ticker.C:
err := conn.WriteMessage(websocket.TextMessage, []byte(t.String()))
if err != nil {
log.Println("write:", err)
return
}
msg := pb.CreateSampleEvent()
msg.Name = "test echo over gorilla websocket"
data, _ := proto.Marshal(msg)
err2 := conn.WriteMessage(websocket.BinaryMessage, data)
if err2 != nil {
log.Println("write:", err2)
return
}
log.Println("gorilla NewTicker()", t.String())
case <-interrupt:
log.Println("interrupt")

View File

@ -60,7 +60,7 @@ func main() {
go processEvents()
// setups up a dnssecsocket()
// go retrySocket()
go retrySocket()
time.Sleep(3 * 1000 * 1000 * 1000)
go gorillaDial()