| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/udp/udp_socket_win.h" | 5 #include "net/udp/udp_socket_win.h" |
| 6 | 6 |
| 7 #include <mstcpip.h> | 7 #include <mstcpip.h> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 return nread; | 385 return nread; |
| 386 | 386 |
| 387 read_callback_ = callback; | 387 read_callback_ = callback; |
| 388 recv_from_address_ = address; | 388 recv_from_address_ = address; |
| 389 return ERR_IO_PENDING; | 389 return ERR_IO_PENDING; |
| 390 } | 390 } |
| 391 | 391 |
| 392 int UDPSocketWin::Write(IOBuffer* buf, | 392 int UDPSocketWin::Write(IOBuffer* buf, |
| 393 int buf_len, | 393 int buf_len, |
| 394 const CompletionCallback& callback) { | 394 const CompletionCallback& callback) { |
| 395 return SendToOrWrite(buf, buf_len, NULL, callback); | 395 return SendToOrWrite(buf, buf_len, remote_address_.get(), callback); |
| 396 } | 396 } |
| 397 | 397 |
| 398 int UDPSocketWin::SendTo(IOBuffer* buf, | 398 int UDPSocketWin::SendTo(IOBuffer* buf, |
| 399 int buf_len, | 399 int buf_len, |
| 400 const IPEndPoint& address, | 400 const IPEndPoint& address, |
| 401 const CompletionCallback& callback) { | 401 const CompletionCallback& callback) { |
| 402 return SendToOrWrite(buf, buf_len, &address, callback); | 402 return SendToOrWrite(buf, buf_len, &address, callback); |
| 403 } | 403 } |
| 404 | 404 |
| 405 int UDPSocketWin::SendToOrWrite(IOBuffer* buf, | 405 int UDPSocketWin::SendToOrWrite(IOBuffer* buf, |
| (...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1170 void UDPSocketWin::DetachFromThread() { | 1170 void UDPSocketWin::DetachFromThread() { |
| 1171 base::NonThreadSafe::DetachFromThread(); | 1171 base::NonThreadSafe::DetachFromThread(); |
| 1172 } | 1172 } |
| 1173 | 1173 |
| 1174 void UDPSocketWin::UseNonBlockingIO() { | 1174 void UDPSocketWin::UseNonBlockingIO() { |
| 1175 DCHECK(!core_); | 1175 DCHECK(!core_); |
| 1176 use_non_blocking_io_ = true; | 1176 use_non_blocking_io_ = true; |
| 1177 } | 1177 } |
| 1178 | 1178 |
| 1179 } // namespace net | 1179 } // namespace net |
| OLD | NEW |