code: func (s *Server) serve(ctx context.Context, l net.Listener, wg *sync.WaitGroup) error {
  	for {
  		conn, err := l.Accept()
  		if err != nil {
  			return err
  		}
  
  		client := &client{
  			conn:   &iotools.DeadlineReader{conn, 0},
  			source: s.Source,
  			email:  s.Email,
  			ctx:    ctx,
  		}
  
  		wg.Add(1)
  		go func() {
  			defer wg.Done()
  
  			paniccatcher.Do(func() {
  				if err := client.handle(); err != nil {
  					logging.Fields{
  						logging.ErrorKey: err,
  					}.Errorf(client.ctx, "failed to handle client request")
  				}
  			}, func(p *paniccatcher.Panic) {
  				logging.Fields{
  					"panicReason": p.Reason,
  				}.Errorf(client.ctx, "panic during client handshake:\n%s", p.Stack)
  			})
  		}()
  	}
  }
docs: // serve runs the serving loop.