Created
August 3, 2016 12:48
-
-
Save barrucadu/715dddfd354606f433776bbee7c1e9c9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for { | |
| // Connect | |
| netConn, err := net.DialTimeout("tcp", c.addr, 5*time.Second) | |
| if err != nil { | |
| logger.Printf("Failed to connect to Stagger: %s", err.Error()) | |
| time.Sleep(time.Second) | |
| continue | |
| } | |
| connection = conn.NewConn(netConn, encoding.Encoding{}) | |
| if err := connection.WriteMessage(conn.RegisterProcess{Tags: c.tags}); err != nil { | |
| logger.Printf("Failed to register process: %s", err.Error()) | |
| time.Sleep(time.Second) | |
| continue | |
| } | |
| // Run the client until it terminates. | |
| err = c.runOnce(connection) | |
| logger.Printf("Lost connection to Stagger: %s", err.Error()) | |
| time.Sleep(time.Second) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment