#define TALK_P2P_BASE_P2PTRANSPORTCHANNEL_H_
#include <map>
-#include <vector>
#include <string>
-#include "talk/base/asyncpacketsocket.h"
-#include "talk/base/sigslot.h"
+#include <vector>
#include "talk/p2p/base/candidate.h"
-#include "talk/p2p/base/portinterface.h"
+#include "talk/p2p/base/p2ptransport.h"
#include "talk/p2p/base/portallocator.h"
+#include "talk/p2p/base/portinterface.h"
#include "talk/p2p/base/transport.h"
#include "talk/p2p/base/transportchannelimpl.h"
-#include "talk/p2p/base/p2ptransport.h"
+#include "webrtc/base/asyncpacketsocket.h"
+#include "webrtc/base/sigslot.h"
namespace cricket {
// P2PTransportChannel manages the candidates and connection process to keep
// two P2P clients connected to each other.
class P2PTransportChannel : public TransportChannelImpl,
- public talk_base::MessageHandler {
+ public rtc::MessageHandler {
public:
P2PTransportChannel(const std::string& content_name,
int component,
// From TransportChannel:
virtual int SendPacket(const char *data, size_t len,
- const talk_base::PacketOptions& options, int flags);
- virtual int SetOption(talk_base::Socket::Option opt, int value);
+ const rtc::PacketOptions& options, int flags);
+ virtual int SetOption(rtc::Socket::Option opt, int value);
virtual int GetError() { return error_; }
virtual bool GetStats(std::vector<ConnectionInfo>* stats);
virtual bool IsDtlsActive() const { return false; }
// Default implementation.
- virtual bool GetSslRole(talk_base::SSLRole* role) const {
+ virtual bool GetSslRole(rtc::SSLRole* role) const {
return false;
}
- virtual bool SetSslRole(talk_base::SSLRole role) {
+ virtual bool SetSslRole(rtc::SSLRole role) {
return false;
}
}
// Returns false because the channel is not encrypted by default.
- virtual bool GetLocalIdentity(talk_base::SSLIdentity** identity) const {
+ virtual bool GetLocalIdentity(rtc::SSLIdentity** identity) const {
return false;
}
- virtual bool GetRemoteCertificate(talk_base::SSLCertificate** cert) const {
+ virtual bool GetRemoteCertificate(rtc::SSLCertificate** cert) const {
return false;
}
return false;
}
- virtual bool SetLocalIdentity(talk_base::SSLIdentity* identity) {
+ virtual bool SetLocalIdentity(rtc::SSLIdentity* identity) {
return false;
}
}
// Helper method used only in unittest.
- talk_base::DiffServCodePoint DefaultDscpValue() const;
+ rtc::DiffServCodePoint DefaultDscpValue() const;
private:
- talk_base::Thread* thread() { return worker_thread_; }
+ rtc::Thread* thread() { return worker_thread_; }
PortAllocatorSession* allocator_session() {
return allocator_sessions_.back();
}
void HandleNotWritable();
void HandleAllTimedOut();
- Connection* GetBestConnectionOnNetwork(talk_base::Network* network);
+ Connection* GetBestConnectionOnNetwork(rtc::Network* network);
bool CreateConnections(const Candidate &remote_candidate,
PortInterface* origin_port, bool readable);
bool CreateConnection(PortInterface* port, const Candidate& remote_candidate,
const std::vector<Candidate>& candidates);
void OnCandidatesAllocationDone(PortAllocatorSession* session);
void OnUnknownAddress(PortInterface* port,
- const talk_base::SocketAddress& addr,
+ const rtc::SocketAddress& addr,
ProtocolType proto,
IceMessage* stun_msg,
const std::string& remote_username,
void OnConnectionStateChange(Connection* connection);
void OnReadPacket(Connection *connection, const char *data, size_t len,
- const talk_base::PacketTime& packet_time);
+ const rtc::PacketTime& packet_time);
void OnReadyToSend(Connection* connection);
void OnConnectionDestroyed(Connection *connection);
void OnUseCandidate(Connection* conn);
- virtual void OnMessage(talk_base::Message *pmsg);
+ virtual void OnMessage(rtc::Message *pmsg);
void OnSort();
void OnPing();
P2PTransport* transport_;
PortAllocator *allocator_;
- talk_base::Thread *worker_thread_;
+ rtc::Thread *worker_thread_;
bool incoming_only_;
bool waiting_for_signaling_;
int error_;
std::vector<RemoteCandidate> remote_candidates_;
bool sort_dirty_; // indicates whether another sort is needed right now
bool was_writable_;
- typedef std::map<talk_base::Socket::Option, int> OptionMap;
+ typedef std::map<rtc::Socket::Option, int> OptionMap;
OptionMap options_;
std::string ice_ufrag_;
std::string ice_pwd_;