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 #ifndef NET_SOCKET_UDP_SERVER_SOCKET_H_ | 5 #ifndef NET_SOCKET_UDP_SERVER_SOCKET_H_ |
6 #define NET_SOCKET_UDP_SERVER_SOCKET_H_ | 6 #define NET_SOCKET_UDP_SERVER_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 21 matching lines...) Expand all Loading... |
32 const CompletionCallback& callback) override; | 32 const CompletionCallback& callback) override; |
33 int SendTo(IOBuffer* buf, | 33 int SendTo(IOBuffer* buf, |
34 int buf_len, | 34 int buf_len, |
35 const IPEndPoint& address, | 35 const IPEndPoint& address, |
36 const CompletionCallback& callback) override; | 36 const CompletionCallback& callback) override; |
37 int SetReceiveBufferSize(int32_t size) override; | 37 int SetReceiveBufferSize(int32_t size) override; |
38 int SetSendBufferSize(int32_t size) override; | 38 int SetSendBufferSize(int32_t size) override; |
39 void Close() override; | 39 void Close() override; |
40 int GetPeerAddress(IPEndPoint* address) const override; | 40 int GetPeerAddress(IPEndPoint* address) const override; |
41 int GetLocalAddress(IPEndPoint* address) const override; | 41 int GetLocalAddress(IPEndPoint* address) const override; |
| 42 void UseNonBlockingIO() override; |
42 const BoundNetLog& NetLog() const override; | 43 const BoundNetLog& NetLog() const override; |
43 void AllowAddressReuse() override; | 44 void AllowAddressReuse() override; |
44 void AllowBroadcast() override; | 45 void AllowBroadcast() override; |
45 int JoinGroup(const IPAddress& group_address) const override; | 46 int JoinGroup(const IPAddress& group_address) const override; |
46 int LeaveGroup(const IPAddress& group_address) const override; | 47 int LeaveGroup(const IPAddress& group_address) const override; |
47 int SetMulticastInterface(uint32_t interface_index) override; | 48 int SetMulticastInterface(uint32_t interface_index) override; |
48 int SetMulticastTimeToLive(int time_to_live) override; | 49 int SetMulticastTimeToLive(int time_to_live) override; |
49 int SetMulticastLoopbackMode(bool loopback) override; | 50 int SetMulticastLoopbackMode(bool loopback) override; |
50 int SetDiffServCodePoint(DiffServCodePoint dscp) override; | 51 int SetDiffServCodePoint(DiffServCodePoint dscp) override; |
51 void DetachFromThread() override; | 52 void DetachFromThread() override; |
52 | 53 |
53 #if defined(OS_WIN) | |
54 // Switch to use non-blocking IO. Must be called right after construction and | |
55 // before other calls. | |
56 void UseNonBlockingIO(); | |
57 #endif | |
58 | |
59 private: | 54 private: |
60 UDPSocket socket_; | 55 UDPSocket socket_; |
61 bool allow_address_reuse_; | 56 bool allow_address_reuse_; |
62 bool allow_broadcast_; | 57 bool allow_broadcast_; |
63 DISALLOW_COPY_AND_ASSIGN(UDPServerSocket); | 58 DISALLOW_COPY_AND_ASSIGN(UDPServerSocket); |
64 }; | 59 }; |
65 | 60 |
66 } // namespace net | 61 } // namespace net |
67 | 62 |
68 #endif // NET_SOCKET_UDP_SERVER_SOCKET_H_ | 63 #endif // NET_SOCKET_UDP_SERVER_SOCKET_H_ |
OLD | NEW |