| 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_UDP_DATAGRAM_SERVER_SOCKET_H_ | 5 #ifndef NET_UDP_DATAGRAM_SERVER_SOCKET_H_ |
| 6 #define NET_UDP_DATAGRAM_SERVER_SOCKET_H_ | 6 #define NET_UDP_DATAGRAM_SERVER_SOCKET_H_ |
| 7 | 7 |
| 8 #include "net/base/completion_callback.h" | 8 #include "net/base/completion_callback.h" |
| 9 #include "net/base/net_util.h" | 9 #include "net/base/net_util.h" |
| 10 #include "net/udp/datagram_socket.h" | 10 #include "net/udp/datagram_socket.h" |
| 11 | 11 |
| 12 namespace net { | 12 namespace net { |
| 13 | 13 |
| 14 class IPEndPoint; | 14 class IPEndPoint; |
| 15 class IOBuffer; | 15 class IOBuffer; |
| 16 | 16 |
| 17 // A UDP Socket. | 17 // A UDP Socket. |
| 18 class NET_EXPORT DatagramServerSocket : public DatagramSocket { | 18 class NET_EXPORT DatagramServerSocket : public DatagramSocket { |
| 19 public: | 19 public: |
| 20 virtual ~DatagramServerSocket() {} | 20 ~DatagramServerSocket() override {} |
| 21 | 21 |
| 22 // Initialize this socket as a server socket listening at |address|. | 22 // Initialize this socket as a server socket listening at |address|. |
| 23 // Returns a network error code. | 23 // Returns a network error code. |
| 24 virtual int Listen(const IPEndPoint& address) = 0; | 24 virtual int Listen(const IPEndPoint& address) = 0; |
| 25 | 25 |
| 26 // Read from a socket and receive sender address information. | 26 // Read from a socket and receive sender address information. |
| 27 // |buf| is the buffer to read data into. | 27 // |buf| is the buffer to read data into. |
| 28 // |buf_len| is the maximum amount of data to read. | 28 // |buf_len| is the maximum amount of data to read. |
| 29 // |address| is a buffer provided by the caller for receiving the sender | 29 // |address| is a buffer provided by the caller for receiving the sender |
| 30 // address information about the received data. This buffer must be kept | 30 // address information about the received data. This buffer must be kept |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 // some platforms. Returns a network error code. | 106 // some platforms. Returns a network error code. |
| 107 virtual int SetDiffServCodePoint(DiffServCodePoint dscp) = 0; | 107 virtual int SetDiffServCodePoint(DiffServCodePoint dscp) = 0; |
| 108 | 108 |
| 109 // Resets the thread to be used for thread-safety checks. | 109 // Resets the thread to be used for thread-safety checks. |
| 110 virtual void DetachFromThread() = 0; | 110 virtual void DetachFromThread() = 0; |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 } // namespace net | 113 } // namespace net |
| 114 | 114 |
| 115 #endif // NET_UDP_DATAGRAM_SERVER_SOCKET_H_ | 115 #endif // NET_UDP_DATAGRAM_SERVER_SOCKET_H_ |
| OLD | NEW |