Skip to content

Instantly share code, notes, and snippets.

@AbstractBeliefs
Forked from barrucadu/no-goto.go
Last active August 3, 2016 12:51
Show Gist options
  • Select an option

  • Save AbstractBeliefs/74ee40754ba1e8541c42fbbe1905135d to your computer and use it in GitHub Desktop.

Select an option

Save AbstractBeliefs/74ee40754ba1e8541c42fbbe1905135d to your computer and use it in GitHub Desktop.
for {
// Connect
try {
netConn, err := net.DialTimeout("tcp", c.addr, 5*time.Second)
connection = conn.NewConn(netConn, encoding.Encoding{})
err = c.runOnce(connection)
logger.Printf("Lost connection to Stagger: %s", err.Error())
}
except (NetworkError e) {
logger.Printf("Connection failed: " + e.Message)
}
finally {
time.Sleep(time.Second)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment