func NewServer(l net.Listener, a Accepter) *Server {
	return &Server{
		listener: l,
		accepter: a,
		stopping: make(chan struct{}),
	}
}
Create a new server.
package agent
import (
	"net"
	"os"
	"os/signal"
	"sync"
)
type Server struct {
	listener net.Listener
	accepter Accepter
	mu       sync.Mutex
	stopped  bool
	stopping chan struct{}
	wg sync.WaitGroup
}
type Accepter interface {
	Accept(net.Conn)
}