Google Talk for Developers

HttpPortAllocator Class

A subclass of the BasicPortAllocator class that exposes methods to specify the address of STUN and relay servers to use. It uses a default hard-coded values defined in the constructor for its STUN and relay servers (Google servers); you should use JingleInfoTask to request the actual current values and reset them appropriately, as described in Set Up the Session Management Pathway. Note that libjingle provides STUN and relay server code that you can use for your own project (StunServer, RelayServer).

You should use HttpPortAllocator unless you have special needs or have extended BasicPortAllocator yourself.

Your application should create an instance of this class after signing in to a server, and pass it into an instance of SessionManager that you have created.

Syntax

class HttpPortAllocator: public BasicPortAllocator

Methods

HttpPortAllocator defines the following key methods.

Name Description
virtual PortAllocatorSession *CreateSession (const std::string &name, const std::string &session_type); Called by SessionManager to create a PortAllocatorSession needed to manage this object. Clients should not need to call this method.
void SetStunHosts(const std::vector<talk_base::SocketAddress> &hosts) Called by the client at the start of a session to set a list of any STUN servers involved in the connection. This list can be retrieved from the JingleInfoTask::SignalJingleInfo signal.
void SetRelayHosts(const std::vector<std::string> &hosts) Called by the client at the start of a session to set a list of any relay servers involved in the connection. This list can be retrieved from the JingleInfoTask::SignalJingleInfo signal.
void SetRelayToken(const std::string &relay) Called by the client at the start of a session to set any relay server tokens needed. This value can be retrieved from the JingleInfoTask::SignalJingleInfo signal.
std::string relay_token() The relay token for the relay server (if used).

Attributes: public

Declaration file: talk/p2p/client/httpportallocator.h

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.