Transform application into a Windows service

Hey there. I got an application that is an UDP socket which keeps an infinite loop used to read the UDP datagrams and reply to the client, this loop executes many tasks, I need to execute this application as a windows service but I need it to stop only when the final end of the loop. Have anyone ever done it before, or got any example to share?


See kardianos/service (


Can’t connect to database inside the run goroutine…


db, err := sql.Open("odbc", "DSN=DTRSOURCE;UID=sa;PWD=12345")

returns error inside goroutine?

Outside this service go routine it works normally…

What is the error? What is your odbc driver?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.