code: func (cli *Client) generatePacketID() (uint16, error) {
  	// Define a Packet Identifier.
  	id := minPacketID
  
  	for {
  		// Find a Packet Identifier which does not used.
  		if _, exist := cli.sess.sendingPackets[id]; !exist {
  			// Return the Packet Identifier.
  			return id, nil
  		}
  
  		if id == maxPacketID {
  			break
  		}
  
  		id++
  	}
  
  	// Return an error if available ids are not found.
  	return 0, ErrPacketIDExhaused
  }
docs: // generatePacketID generates and returns a Packet Identifier.