code: func (s *Session) incomingStream(id uint32) error {
  	// Reject immediately if we are doing a go away
  	if atomic.LoadInt32(&s.localGoAway) == 1 {
  		hdr := header(make([]byte, headerSize))
  		hdr.encode(typeWindowUpdate, flagRST, id, 0)
  		return s.sendNoWait(hdr)
  	}
  
  	// Allocate a new stream
  	stream := newStream(s, id, streamSYNReceived)
  
  	s.streamLock.Lock()
  	defer s.streamLock.Unlock()
  
  	// Check if stream already exists
  	if _, ok := s.streams[id]; ok {
  		s.logger.Printf("[ERR] yamux: duplicate stream declared")
  		if sendErr := s.sendNoWait(s.goAway(goAwayProtoErr)); sendErr != nil {
  			s.logger.Printf("[WARN] yamux: failed to send go away: %v", sendErr)
  		}
  		return ErrDuplicateStream
  	}
  
  	// Register the stream
  	s.streams[id] = stream
  
  	// Check if we've exceeded the backlog
  	select {
  	case s.acceptCh <- stream:
  		return nil
  	default:
  		// Backlog exceeded! RST the stream
  		s.logger.Printf("[WARN] yamux: backlog exceeded, forcing connection reset")
  		delete(s.streams, id)
  		stream.sendHdr.encode(typeWindowUpdate, flagRST, id, 0)
  		return s.sendNoWait(stream.sendHdr)
  	}
  }
docs: // incomingStream is used to create a new incoming stream