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.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.