code: func (l *Listener) packetInput(data []byte, addr net.Addr) {
  	dataValid := false
  	if l.block != nil {
  		l.block.Decrypt(data, data)
  		data = data[nonceSize:]
  		checksum := crc32.ChecksumIEEE(data[crcSize:])
  		if checksum == binary.LittleEndian.Uint32(data) {
  			data = data[crcSize:]
  			dataValid = true
  		} else {
  			atomic.AddUint64(&DefaultSnmp.InCsumErrors, 1)
  		}
  	} else if l.block == nil {
  		dataValid = true
  	}
  
  	if dataValid {
  		l.sessionLock.Lock()
  		s, ok := l.sessions[addr.String()]
  		l.sessionLock.Unlock()
  
  		if !ok { // new address:port
  			if len(l.chAccepts) < cap(l.chAccepts) { // do not let the new sessions overwhelm accept queue
  				var conv uint32
  				convValid := false
  				if l.fecDecoder != nil {
  					isfec := binary.LittleEndian.Uint16(data[4:])
  					if isfec == typeData {
  						conv = binary.LittleEndian.Uint32(data[fecHeaderSizePlus2:])
  						convValid = true
  					}
  				} else {
  					conv = binary.LittleEndian.Uint32(data)
  					convValid = true
  				}
  
  				if convValid { // creates a new session only if the 'conv' field in kcp is accessible
  					s := newUDPSession(conv, l.dataShards, l.parityShards, l, l.conn, addr, l.block)
  					s.kcpInput(data)
  					l.sessionLock.Lock()
  					l.sessions[addr.String()] = s
  					l.sessionLock.Unlock()
  					l.chAccepts <- s
  				}
  			}
  		} else {
  			s.kcpInput(data)
  		}
  	}
  }
docs: // packet input stage