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

Unified Diff: cloud_print/gcp20/prototype/dns_sd_server.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: cloud_print/gcp20/prototype/dns_sd_server.cc
diff --git a/cloud_print/gcp20/prototype/dns_sd_server.cc b/cloud_print/gcp20/prototype/dns_sd_server.cc
index a43f9f0851483fa870acf9923a963bf5a9de6955..78d98127320e0dcd02877ef8899e496e3a2c819e 100644
--- a/cloud_print/gcp20/prototype/dns_sd_server.cc
+++ b/cloud_print/gcp20/prototype/dns_sd_server.cc
@@ -123,9 +123,7 @@ bool DnsSdServer::CreateSocket() {
DCHECK(success);
- socket_.reset(new net::UDPSocket(net::DatagramSocket::DEFAULT_BIND,
- net::RandIntCallback(), NULL,
- net::NetLog::Source()));
+ socket_.reset(new net::UDPServerSocket(NULL, net::NetLog::Source()));
net::IPEndPoint local_address = net::IPEndPoint(local_ip_any,
kDefaultPortMulticast);
@@ -134,7 +132,7 @@ bool DnsSdServer::CreateSocket() {
socket_->AllowAddressReuse();
- int status = socket_->Bind(local_address);
+ int status = socket_->Listen(local_address);
if (status < 0)
return false;
@@ -143,9 +141,6 @@ bool DnsSdServer::CreateSocket() {
if (status < 0)
return false;
-
- DCHECK(socket_->is_connected());
-
return true;
}

Powered by Google App Engine
This is Rietveld 408576698