Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1648)

Unified Diff: webrtc/p2p/base/tcpport.h

Issue 2936553003: Adding PortAllocator option to support cases where sockets can't be bound. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/p2p/base/tcpport.h
diff --git a/webrtc/p2p/base/tcpport.h b/webrtc/p2p/base/tcpport.h
index 76a73f8f474fdf3600c0902d5f6d0c504cf4d15c..ce91e449057554f58f37b5ba3754c22c9c858a1a 100644
--- a/webrtc/p2p/base/tcpport.h
+++ b/webrtc/p2p/base/tcpport.h
@@ -39,13 +39,8 @@ class TCPPort : public Port {
const std::string& username,
const std::string& password,
bool allow_listen) {
- TCPPort* port = new TCPPort(thread, factory, network, ip, min_port,
- max_port, username, password, allow_listen);
- if (!port->Init()) {
- delete port;
- port = NULL;
- }
- return port;
+ return new TCPPort(thread, factory, network, ip, min_port, max_port,
+ username, password, allow_listen);
}
~TCPPort() override;
@@ -73,7 +68,6 @@ class TCPPort : public Port {
const std::string& username,
const std::string& password,
bool allow_listen);
- bool Init();
// Handles sending using the local TCP socket.
int SendTo(const void* data,
@@ -92,6 +86,8 @@ class TCPPort : public Port {
rtc::AsyncPacketSocket* socket;
};
+ void TryCreateServerSocket();
+
rtc::AsyncPacketSocket* GetIncoming(
const rtc::SocketAddress& addr, bool remove = false);

Powered by Google App Engine
This is Rietveld 408576698