mapDetailed

suspend fun mapDetailed(internalPort: Int, externalPort: Int, tcp: Boolean, lifetimeSeconds: Int = 3600): NatPmp.MapGrant?

Like map, but returns the full grant (the granted external port and the lifetime the gateway assigned), so the engine can drive its refresh timer. Mirrors the same send_map_requeston_reply transaction.

Returns null if the gateway never answered within maxAttempts retransmissions or replied with a non-zero result code. Pass lifetimeSeconds = 0 to delete.