IRTCSessionPortManagement::SetPortManager

The SetPortManager method allows an application to specify its callback interface that allows the RTC Client API to obtain NAT mappings when required. This interface is required only when a NAT is in place that does not support UPnP functionality. If this method is not called, the RTC Client API will support only those NATs that support UPnP functionality by default. This method can be called multiple times when the session is idle (the session has been created, but participants have not been added to the session). Each successful call to SetPortManager overwrites the previous IRTCPortManager callback interface. The method returns an error if called when the session is not idle.

Note  The application should be prepared to return the port mappings immediately after the application calls SetPortManager.

HRESULT SetPortManager(IRTCPortManager*pPortManager);

Parameters

  • pPortManager
    [in] Pointer to the interface exposed by the application to allow the RTC Client API to obtain a port mapping. A null pointer is allowed.

Return Values

RTC methods may return an RTC_E_ constant as well as any of the standard COM and ADSI return values.

Value Meaning
S_OK The interface has been successfully set.
RTC_E_INVALID_SESSION_TYPE The interface cannot be set on this type of session.
E_FAIL The interface has not been successfully set.

Remarks

This function may send data over the wire in unencrypted form; therefore, someone eavesdropping on the network may be able to read the data. The security risk of sending the data in clear text should be considered before using this method in an unencrypted session. An RTC session can be encrypted by specifying TLS in the profile used for the session.

Requirements

Client: Requires Windows XP SP1.
Server: Requires Windows Server 2003.
Redistributable: Requires Rtcdll.dll on Windows 2000, Windows XP, and Windows Me/98.
Header: Declared in Rtccore.h.
Library: Included as a resource in Rtcdll.dll.
GUID: IID_IRTCSessionPortManagement is defined as a072f1d6-0286-4e1f-85f2-17a2948456ec.

See Also

IRTCSessionPortManagement, IRTCPortManager, Receive an Incoming Session When the Client is Behind a NAT, Create an Outgoing Session When the Client is Behind a NAT