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 // handle inbound messages on the channel
go readGorillaConn(done, conn) go readGorillaConn(done, conn)
ticker := time.NewTicker(time.Second) ticker := time.NewTicker(time.Second * 10)
defer ticker.Stop() defer ticker.Stop()
for { for {
@ -85,20 +85,7 @@ func gorillaDial() {
case <-done: case <-done:
return return
case t := <-ticker.C: case t := <-ticker.C:
err := conn.WriteMessage(websocket.TextMessage, []byte(t.String())) log.Println("gorilla NewTicker()", 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
}
case <-interrupt: case <-interrupt:
log.Println("interrupt") log.Println("interrupt")

View File

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