OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef NET_SOCKET_UDP_CLIENT_SOCKET_H_ | 5 #ifndef NET_SOCKET_UDP_CLIENT_SOCKET_H_ |
6 #define NET_SOCKET_UDP_CLIENT_SOCKET_H_ | 6 #define NET_SOCKET_UDP_CLIENT_SOCKET_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 public: | 22 public: |
23 UDPClientSocket(DatagramSocket::BindType bind_type, | 23 UDPClientSocket(DatagramSocket::BindType bind_type, |
24 const RandIntCallback& rand_int_cb, | 24 const RandIntCallback& rand_int_cb, |
25 net::NetLog* net_log, | 25 net::NetLog* net_log, |
26 const net::NetLog::Source& source); | 26 const net::NetLog::Source& source); |
27 ~UDPClientSocket() override; | 27 ~UDPClientSocket() override; |
28 | 28 |
29 // DatagramClientSocket implementation. | 29 // DatagramClientSocket implementation. |
30 int BindToNetwork(NetworkChangeNotifier::NetworkHandle network) override; | 30 int BindToNetwork(NetworkChangeNotifier::NetworkHandle network) override; |
31 int BindToDefaultNetwork() override; | 31 int BindToDefaultNetwork() override; |
32 NetworkChangeNotifier::NetworkHandle GetBoundNetwork() override; | 32 NetworkChangeNotifier::NetworkHandle GetBoundNetwork() const override; |
33 int Connect(const IPEndPoint& address) override; | 33 int Connect(const IPEndPoint& address) override; |
34 int Read(IOBuffer* buf, | 34 int Read(IOBuffer* buf, |
35 int buf_len, | 35 int buf_len, |
36 const CompletionCallback& callback) override; | 36 const CompletionCallback& callback) override; |
37 int Write(IOBuffer* buf, | 37 int Write(IOBuffer* buf, |
38 int buf_len, | 38 int buf_len, |
39 const CompletionCallback& callback) override; | 39 const CompletionCallback& callback) override; |
40 void Close() override; | 40 void Close() override; |
41 int GetPeerAddress(IPEndPoint* address) const override; | 41 int GetPeerAddress(IPEndPoint* address) const override; |
42 int GetLocalAddress(IPEndPoint* address) const override; | 42 int GetLocalAddress(IPEndPoint* address) const override; |
43 int SetReceiveBufferSize(int32_t size) override; | 43 int SetReceiveBufferSize(int32_t size) override; |
44 int SetSendBufferSize(int32_t size) override; | 44 int SetSendBufferSize(int32_t size) override; |
45 const BoundNetLog& NetLog() const override; | 45 const BoundNetLog& NetLog() const override; |
46 | 46 |
47 #if defined(OS_WIN) | 47 #if defined(OS_WIN) |
48 // Switch to use non-blocking IO. Must be called right after construction and | 48 // Switch to use non-blocking IO. Must be called right after construction and |
49 // before other calls. | 49 // before other calls. |
50 void UseNonBlockingIO(); | 50 void UseNonBlockingIO(); |
51 #endif | 51 #endif |
52 | 52 |
53 private: | 53 private: |
54 UDPSocket socket_; | 54 UDPSocket socket_; |
55 NetworkChangeNotifier::NetworkHandle network_; | 55 NetworkChangeNotifier::NetworkHandle network_; |
56 DISALLOW_COPY_AND_ASSIGN(UDPClientSocket); | 56 DISALLOW_COPY_AND_ASSIGN(UDPClientSocket); |
57 }; | 57 }; |
58 | 58 |
59 } // namespace net | 59 } // namespace net |
60 | 60 |
61 #endif // NET_SOCKET_UDP_CLIENT_SOCKET_H_ | 61 #endif // NET_SOCKET_UDP_CLIENT_SOCKET_H_ |
OLD | NEW |