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

Unified Diff: media/cast/test/utility/udp_proxy.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
« no previous file with comments | « media/cast/test/utility/net_utility.cc ('k') | net/udp/udp_client_socket.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/test/utility/udp_proxy.cc
diff --git a/media/cast/test/utility/udp_proxy.cc b/media/cast/test/utility/udp_proxy.cc
index 658c8c3cf7678b093cc9764de95617959c1eab6e..c3dfde6ba494b82ad7f928df2852520593969287 100644
--- a/media/cast/test/utility/udp_proxy.cc
+++ b/media/cast/test/utility/udp_proxy.cc
@@ -15,7 +15,7 @@
#include "base/time/default_tick_clock.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
-#include "net/udp/udp_socket.h"
+#include "net/udp/udp_server_socket.h"
namespace media {
namespace cast {
@@ -738,10 +738,7 @@ class UDPProxyImpl : public UDPProxy {
private:
void Start(base::WaitableEvent* start_event,
net::NetLog* net_log) {
- socket_.reset(new net::UDPSocket(net::DatagramSocket::DEFAULT_BIND,
- net::RandIntCallback(),
- net_log,
- net::NetLog::Source()));
+ socket_.reset(new net::UDPServerSocket(net_log, net::NetLog::Source()));
BuildPipe(&to_dest_pipe_, new PacketSender(this, &destination_));
BuildPipe(&from_dest_pipe_, new PacketSender(this, &return_address_));
to_dest_pipe_->InitOnIOThread(base::MessageLoopProxy::current(),
@@ -753,7 +750,7 @@ class UDPProxyImpl : public UDPProxy {
if (!destination_is_mutable_)
VLOG(0) << "To:" << destination_.ToString();
- CHECK_GE(socket_->Bind(local_port_), 0);
+ CHECK_GE(socket_->Listen(local_port_), 0);
start_event->Signal();
PollRead();
@@ -830,7 +827,7 @@ class UDPProxyImpl : public UDPProxy {
base::DefaultTickClock tick_clock_;
base::Thread proxy_thread_;
- scoped_ptr<net::UDPSocket> socket_;
+ scoped_ptr<net::UDPServerSocket> socket_;
scoped_ptr<PacketPipe> to_dest_pipe_;
scoped_ptr<PacketPipe> from_dest_pipe_;
« no previous file with comments | « media/cast/test/utility/net_utility.cc ('k') | net/udp/udp_client_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698