Sunday, October 15, 2017

Multiport Server in Go...

Today was a little windy for outdoor work on the solar panel tracker, so I updated the Go code to include a more graceful exit:

  • Logging server listens to quit chan
  • Time server listens to quit chan
  • Quit server closes quit chan
  • All servers quit, which causes defer to close all db & net connections
  • Main quits and exits to os.

This way I can telnet to port 6660 and kill all the services in one swoop, and know that the db connection was also gracefully closed.

No comments:

Post a Comment