| Previous | Next |
| RTC_E_PORT_MAPPING_UNAVAILABLE | RTC_E_SECURITY_LEVEL_NOT_COMPATIBLE |
RTC_E_PORT_MAPPING_FAILED
What the RTC value marks: RTC_E_PORT_MAPPING_FAILED
The legacy RTC Client API reports this result while working with registering listening sockets and supplying internal/external media mappings before session establishment; the precise meaning of it is the port manager returned a concrete failure while creating or retrieving a mapping, not merely that a call or registration failed.
For correlation, retain 0x80EE0046 in the RTC interface facility 0xEE together with this result; generic HRESULT text can otherwise hide the protocol family and the exact RTC branch.
Evidence should show that you preserve the port-manager HRESULT, requested tuple, NAT device response, and existing allocations; the diagnostic distinction is that this code indicates an attempted mapping failed, stronger than merely unavailable capability.
Protocol and object state
| RTC area | RTC listening and NAT port-mapping |
|---|---|
| Objects to correlate | IRTCClientPortManagement, IRTCSessionPortManagement, IRTCPortManager, address/port range and mapping lifetime |
| Condition to prove | the port manager returned a concrete failure while creating or retrieving a mapping |
| Safe corrective direction | repair the mapping component or choose another allowed port and repeat before session initiation |
For outgoing sessions the port manager must be set before adding the participant; for incoming sessions it must be set before acceptance. The address advertised in SDP and the local socket receiving media are different values when NAT mapping is involved.
Evidence that separates the cause
- Code-specific proof: preserve the port-manager HRESULT, requested tuple, NAT device response, and existing allocations.
- Identity and target: mapping owner and lifetime.
- State at production: listen registration state.
- Timing and ordering:
SDPaddress derived from mapping.
Related RTC results
RTC_E_PORT_MAPPING_UNAVAILABLE | the port manager cannot provide a usable internal/external mapping for the requested media flow |
|---|---|
RTC_E_PORT_MANAGER_ALREADY_SET | the session already has a port-manager callback and RTC forbids replacing it at this stage |
RTC_E_INVALID_LISTEN_SOCKET | the address and port supplied for RTC listening cannot be bound or accepted as a valid listen tuple |
A safe diagnostic sequence
- Collect enough evidence to preserve the port-manager HRESULT, requested tuple, NAT device response, and existing allocations.
- Test the competing explanation explicitly, because this code indicates an attempted mapping failed, stronger than merely unavailable capability.
- Apply the targeted fix — repair the mapping component or choose another allowed port and repeat before session initiation — and validate both protocol completion and object cleanup.
How to handle the result
The appropriate response to it is not a blanket reconnect. Instead, repair the mapping component or choose another allowed port and repeat before session initiation, while preserving ownership of cleanup and any bounded retry.
Example: UPnP mapping creation is rejected by the gateway for the requested external port.
Actions that do not address this condition
- Do not advertise an external mapping before confirming that it belongs to the current local socket.
- Do not set or replace the port manager after session initiation has consumed the mapping.
Technical references
Looking for a different code? Search another status or error code.
