提交 ae62d435 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

ICE => Ice

上级 e1997532
......@@ -10,7 +10,7 @@
namespace RTC
{
class ICEServer
class IceServer
{
public:
class Listener
......@@ -20,12 +20,12 @@ namespace RTC
* These callbacks are guaranteed to be called before ProcessSTUNMessage()
* returns, so the given pointers are still usable.
*/
virtual void onOutgoingSTUNMessage(ICEServer* iceServer, RTC::STUNMessage* msg, RTC::TransportSource* source) = 0;
virtual void onICEValidPair(ICEServer* iceServer, RTC::TransportSource* source, bool has_use_candidate) = 0;
virtual void onOutgoingSTUNMessage(IceServer* iceServer, RTC::STUNMessage* msg, RTC::TransportSource* source) = 0;
virtual void onICEValidPair(IceServer* iceServer, RTC::TransportSource* source, bool has_use_candidate) = 0;
};
public:
ICEServer(Listener* listener, std::string& usernameFragment, std::string password);
IceServer(Listener* listener, std::string& usernameFragment, std::string password);
void Close();
void ProcessSTUNMessage(RTC::STUNMessage* msg, RTC::TransportSource* source);
......@@ -43,13 +43,13 @@ namespace RTC
/* Inline methods. */
inline
std::string& ICEServer::GetUsernameFragment()
std::string& IceServer::GetUsernameFragment()
{
return this->usernameFragment;
}
inline
std::string& ICEServer::GetPassword()
std::string& IceServer::GetPassword()
{
return this->password;
}
......
......@@ -3,7 +3,7 @@
#include "common.h"
#include "RTC/IceCandidate.h"
#include "RTC/ICEServer.h"
#include "RTC/IceServer.h"
#include "RTC/STUNMessage.h"
#include "RTC/TransportSource.h"
#include "RTC/UDPSocket.h"
......@@ -16,7 +16,7 @@
namespace RTC
{
class IceTransport :
public RTC::ICEServer::Listener,
public RTC::IceServer::Listener,
public RTC::UDPSocket::Listener,
public RTC::TCPServer::Listener,
public RTC::TCPConnection::Reader
......@@ -51,10 +51,10 @@ namespace RTC
std::vector<IceCandidate>& GetIceLocalCandidates();
// IceTransport* CreateAssociatedGatherer(); // TODO: let's see.
/* Pure virtual methods inherited from RTC::ICEServer::Listener. */
/* Pure virtual methods inherited from RTC::IceServer::Listener. */
public:
virtual void onOutgoingSTUNMessage(RTC::ICEServer* iceServer, RTC::STUNMessage* msg, RTC::TransportSource* source) override;
virtual void onICEValidPair(RTC::ICEServer* iceServer, RTC::TransportSource* source, bool has_use_candidate) override;
virtual void onOutgoingSTUNMessage(RTC::IceServer* iceServer, RTC::STUNMessage* msg, RTC::TransportSource* source) override;
virtual void onICEValidPair(RTC::IceServer* iceServer, RTC::TransportSource* source, bool has_use_candidate) override;
/* Private methods to unify UDP and TCP behavior. */
private:
......@@ -85,7 +85,7 @@ namespace RTC
// Passed by argument.
Listener* listener = nullptr;
// Allocated by this.
RTC::ICEServer* iceServer = nullptr;
RTC::IceServer* iceServer = nullptr;
std::vector<RTC::UDPSocket*> udpSockets;
std::vector<RTC::TCPServer*> tcpServers;
// Others.
......
#define MS_CLASS "RTC::ICEServer"
#define MS_CLASS "RTC::IceServer"
#include "RTC/ICEServer.h"
#include "RTC/IceServer.h"
#include "Logger.h"
namespace RTC
{
/* Instance methods. */
ICEServer::ICEServer(Listener* listener, std::string& usernameFragment, std::string password) :
IceServer::IceServer(Listener* listener, std::string& usernameFragment, std::string password) :
listener(listener),
usernameFragment(usernameFragment),
password(password)
......@@ -17,14 +17,14 @@ namespace RTC
MS_DEBUG("[usernameFragment:%s, password:%s]", this->usernameFragment.c_str(), this->password.c_str());
}
void ICEServer::Close()
void IceServer::Close()
{
MS_TRACE();
delete this;
}
void ICEServer::ProcessSTUNMessage(RTC::STUNMessage* msg, RTC::TransportSource* source)
void IceServer::ProcessSTUNMessage(RTC::STUNMessage* msg, RTC::TransportSource* source)
{
MS_TRACE();
......
......@@ -42,14 +42,14 @@ namespace RTC
MS_DEBUG("[udp:%s, tcp:%s]",
option_udp ? "true" : "false", option_tcp ? "true" : "false");
// Create an ICEServer.
// Create an IceServer.
char _username_fragment[16];
char _password[16];
std::string usernameFragment = std::string(Utils::Crypto::GetRandomHexString(_username_fragment, 16), 16);
std::string password = std::string(Utils::Crypto::GetRandomHexString(_password, 32), 32);
this->iceServer = new RTC::ICEServer(this, usernameFragment, password);
this->iceServer = new RTC::IceServer(this, usernameFragment, password);
// Fill IceParameters.
this->iceLocalParameters.usernameFragment = this->iceServer->GetUsernameFragment();
......@@ -184,14 +184,14 @@ namespace RTC
return data;
}
void IceTransport::onOutgoingSTUNMessage(RTC::ICEServer* iceServer, RTC::STUNMessage* msg, RTC::TransportSource* source)
void IceTransport::onOutgoingSTUNMessage(RTC::IceServer* iceServer, RTC::STUNMessage* msg, RTC::TransportSource* source)
{
MS_TRACE();
// TODO
}
void IceTransport::onICEValidPair(RTC::ICEServer* iceServer, RTC::TransportSource* source, bool has_use_candidate)
void IceTransport::onICEValidPair(RTC::IceServer* iceServer, RTC::TransportSource* source, bool has_use_candidate)
{
MS_TRACE();
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论