| 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_UDP_SOCKET_LIBEVENT_H_ | 5 #ifndef NET_UDP_UDP_SOCKET_LIBEVENT_H_ |
| 6 #define NET_UDP_UDP_SOCKET_LIBEVENT_H_ | 6 #define NET_UDP_UDP_SOCKET_LIBEVENT_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // Returns a net error code. | 38 // Returns a net error code. |
| 39 int Connect(const IPEndPoint& address); | 39 int Connect(const IPEndPoint& address); |
| 40 | 40 |
| 41 // Binds the address/port for this socket to |address|. This is generally | 41 // Binds the address/port for this socket to |address|. This is generally |
| 42 // only used on a server. Should be called after Open(). | 42 // only used on a server. Should be called after Open(). |
| 43 // Returns a net error code. | 43 // Returns a net error code. |
| 44 int Bind(const IPEndPoint& address); | 44 int Bind(const IPEndPoint& address); |
| 45 | 45 |
| 46 // Closes the socket. | 46 // Closes the socket. |
| 47 // TODO(rvargas, hidehiko): Disallow re-Open() after Close(). | 47 // TODO(rvargas, hidehiko): Disallow re-Open() after Close(). |
| 48 void Close(); | 48 int Close(); |
| 49 | 49 |
| 50 // Copies the remote udp address into |address| and returns a net error code. | 50 // Copies the remote udp address into |address| and returns a net error code. |
| 51 int GetPeerAddress(IPEndPoint* address) const; | 51 int GetPeerAddress(IPEndPoint* address) const; |
| 52 | 52 |
| 53 // Copies the local udp address into |address| and returns a net error code. | 53 // Copies the local udp address into |address| and returns a net error code. |
| 54 // (similar to getsockname) | 54 // (similar to getsockname) |
| 55 int GetLocalAddress(IPEndPoint* address) const; | 55 int GetLocalAddress(IPEndPoint* address) const; |
| 56 | 56 |
| 57 // IO: | 57 // IO: |
| 58 // Multiple outstanding read requests are not supported. | 58 // Multiple outstanding read requests are not supported. |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 CompletionCallback write_callback_; | 297 CompletionCallback write_callback_; |
| 298 | 298 |
| 299 BoundNetLog net_log_; | 299 BoundNetLog net_log_; |
| 300 | 300 |
| 301 DISALLOW_COPY_AND_ASSIGN(UDPSocketLibevent); | 301 DISALLOW_COPY_AND_ASSIGN(UDPSocketLibevent); |
| 302 }; | 302 }; |
| 303 | 303 |
| 304 } // namespace net | 304 } // namespace net |
| 305 | 305 |
| 306 #endif // NET_UDP_UDP_SOCKET_LIBEVENT_H_ | 306 #endif // NET_UDP_UDP_SOCKET_LIBEVENT_H_ |
| OLD | NEW |