code: func (e *endpoint) Listen(backlog int) (err *tcpip.Error) {
  	e.mu.Lock()
  	defer e.mu.Unlock()
  	defer func() {
  		if err != nil && !err.IgnoreStats() {
  			e.stack.Stats().TCP.FailedConnectionAttempts.Increment()
  		}
  	}()
  
  	// Allow the backlog to be adjusted if the endpoint is not shutting down.
  	// When the endpoint shuts down, it sets workerCleanup to true, and from
  	// that point onward, acceptedChan is the responsibility of the cleanup()
  	// method (and should not be touched anywhere else, including here).
  	if e.state == stateListen && !e.workerCleanup {
  		// Adjust the size of the channel iff we can fix existing
  		// pending connections into the new one.
  		if len(e.acceptedChan) > backlog {
  			return tcpip.ErrInvalidEndpointState
  		}
  		if cap(e.acceptedChan) == backlog {
  			return nil
  		}
  		origChan := e.acceptedChan
  		e.acceptedChan = make(chan *endpoint, backlog)
  		close(origChan)
  		for ep := range origChan {
  			e.acceptedChan <- ep
  		}
  		return nil
  	}
  
  	// Endpoint must be bound before it can transition to listen mode.
  	if e.state != stateBound {
  		return tcpip.ErrInvalidEndpointState
  	}
  
  	// Register the endpoint.
  	if err := e.stack.RegisterTransportEndpoint(e.boundNICID, e.effectiveNetProtos, ProtocolNumber, e.id, e, e.reusePort); err != nil {
  		return err
  	}
  
  	e.isRegistered = true
  	e.state = stateListen
  	if e.acceptedChan == nil {
  		e.acceptedChan = make(chan *endpoint, backlog)
  	}
  	e.workerRunning = true
  
  	e.stack.Stats().TCP.PassiveConnectionOpenings.Increment()
  	go e.protocolListenLoop(
  		seqnum.Size(e.receiveBufferAvailable()))
  
  	return nil
  }
docs: // Listen puts the endpoint in "listen" mode, which allows it to accept
  // new connections.