Stun Server
Compliant with the latest RFCs including 5389, 5769, and 5780
discover the local host's own external IP address
|
#include "socketaddress.h"
Go to the source code of this file.
Functions | |
bool | HasAtLeastTwoAdapters (int family) |
HRESULT | GetBestAddressForSocketBind (bool fPrimary, int family, uint16_t port, CSocketAddress *pSocketAddr) |
HRESULT | GetSocketAddressForAdapter (int family, const char *pszAdapterName, uint16_t port, CSocketAddress *pSocketAddr) |
HRESULT GetBestAddressForSocketBind | ( | bool | fPrimary, |
int | family, | ||
uint16_t | port, | ||
CSocketAddress * | pSocketAddr | ||
) |
Suggests a default adapter for a given stun server socket
fPrimary | - true if the returned adapter is to be used for the primary socket in a stun server. Typically passing "true" means "return the first adapter enumerated", otherwise return the second adapter enumerated" |
family | - Either AF_INET or AF_INET6 |
pSocketAddr | - OUT param. On success, contains the address to bind to |
Definition at line 83 of file adapters.cpp.
HRESULT GetSocketAddressForAdapter | ( | int | family, |
const char * | pszAdapterName, | ||
uint16_t | port, | ||
CSocketAddress * | pSocketAddr | ||
) |
Definition at line 111 of file adapters.cpp.
bool HasAtLeastTwoAdapters | ( | int | family | ) |
Returns true if there are two or more host interfaces(adapters) for the specified family of IP addresses that are both "up" and not loopback adapters
family | either AF_INET or AF_INET6 |
Definition at line 54 of file adapters.cpp.