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

Unified Diff: media/cast/test/utility/net_utility.cc

Issue 721273002: Remove timing limitation to set Broadcast, ReceiveBuffer, and SendBuffer options from UDPSocket. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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: media/cast/test/utility/net_utility.cc
diff --git a/media/cast/test/utility/net_utility.cc b/media/cast/test/utility/net_utility.cc
index d0bc2ad328f4df88cc7dbc7f234732019785f40d..c146d9ab59a99dbb0d32f6b50827ec16e16f627d 100644
--- a/media/cast/test/utility/net_utility.cc
+++ b/media/cast/test/utility/net_utility.cc
@@ -6,7 +6,7 @@
#include "base/basictypes.h"
#include "net/base/net_errors.h"
-#include "net/udp/udp_socket.h"
+#include "net/udp/udp_server_socket.h"
namespace media {
namespace cast {
@@ -19,13 +19,10 @@ net::IPEndPoint GetFreeLocalPort() {
localhost.push_back(0);
localhost.push_back(0);
localhost.push_back(1);
- scoped_ptr<net::UDPSocket> receive_socket(
- new net::UDPSocket(net::DatagramSocket::DEFAULT_BIND,
- net::RandIntCallback(),
- NULL,
- net::NetLog::Source()));
+ scoped_ptr<net::UDPServerSocket> receive_socket(
+ new net::UDPServerSocket(NULL, net::NetLog::Source()));
receive_socket->AllowAddressReuse();
- CHECK_EQ(net::OK, receive_socket->Bind(net::IPEndPoint(localhost, 0)));
+ CHECK_EQ(net::OK, receive_socket->Listen(net::IPEndPoint(localhost, 0)));
net::IPEndPoint endpoint;
CHECK_EQ(net::OK, receive_socket->GetLocalAddress(&endpoint));
return endpoint;

Powered by Google App Engine
This is Rietveld 408576698