| Index: extensions/browser/api/socket/udp_socket.cc
|
| diff --git a/extensions/browser/api/socket/udp_socket.cc b/extensions/browser/api/socket/udp_socket.cc
|
| index e65957493849ae6d1b85eb500974e712870ecfe6..133a09be1a6bd8afd6c62114d198e854b1e6af3f 100644
|
| --- a/extensions/browser/api/socket/udp_socket.cc
|
| +++ b/extensions/browser/api/socket/udp_socket.cc
|
| @@ -33,7 +33,8 @@ UDPSocket::UDPSocket(const std::string& owner_extension_id)
|
| socket_(net::DatagramSocket::DEFAULT_BIND,
|
| net::RandIntCallback(),
|
| NULL,
|
| - net::NetLog::Source()) {}
|
| + net::NetLog::Source()),
|
| + allow_address_reuse_(false) {}
|
|
|
| UDPSocket::~UDPSocket() { Disconnect(); }
|
|
|
| @@ -74,6 +75,10 @@ int UDPSocket::Bind(const std::string& address, uint16_t port) {
|
| if (result != net::OK)
|
| return result;
|
|
|
| + if (allow_address_reuse()) {
|
| + socket_.AllowAddressReuse();
|
| + }
|
| +
|
| result = socket_.Bind(ip_end_point);
|
| if (result != net::OK)
|
| socket_.Close();
|
|
|