Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(579)

Side by Side Diff: net/udp/datagram_client_socket.h

Issue 2508593002: net: move udp directory into socket (Closed)
Patch Set: revert sys/socket.h change Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/tools/quic/quic_simple_server_packet_writer.cc ('k') | net/udp/datagram_server_socket.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef NET_UDP_DATAGRAM_CLIENT_SOCKET_H_
6 #define NET_UDP_DATAGRAM_CLIENT_SOCKET_H_
7
8 #include "net/base/net_export.h"
9 #include "net/base/network_change_notifier.h"
10 #include "net/socket/socket.h"
11 #include "net/udp/datagram_socket.h"
12
13 namespace net {
14
15 class IPEndPoint;
16
17 class NET_EXPORT_PRIVATE DatagramClientSocket : public DatagramSocket,
18 public Socket {
19 public:
20 ~DatagramClientSocket() override {}
21
22 // Initialize this socket as a client socket to server at |address|.
23 // Returns a network error code.
24 virtual int Connect(const IPEndPoint& address) = 0;
25
26 // Binds this socket to |network| and initializes socket as a client socket
27 // to server at |address|. All data traffic on the socket will be sent and
28 // received via |network|. This call will fail if |network| has disconnected.
29 // Communication using this socket will fail if |network| disconnects.
30 // Returns a net error code.
31 virtual int ConnectUsingNetwork(NetworkChangeNotifier::NetworkHandle network,
32 const IPEndPoint& address) = 0;
33
34 // Same as ConnectUsingNetwork, except that the current default network is
35 // used. Returns a net error code.
36 virtual int ConnectUsingDefaultNetwork(const IPEndPoint& address) = 0;
37
38 // Returns the network that either ConnectUsingNetwork() or
39 // ConnectUsingDefaultNetwork() bound this socket to. Returns
40 // NetworkChangeNotifier::kInvalidNetworkHandle if not explicitly bound via
41 // ConnectUsingNetwork() or ConnectUsingDefaultNetwork().
42 virtual NetworkChangeNotifier::NetworkHandle GetBoundNetwork() const = 0;
43
44 };
45
46 } // namespace net
47
48 #endif // NET_UDP_DATAGRAM_CLIENT_SOCKET_H_
OLDNEW
« no previous file with comments | « net/tools/quic/quic_simple_server_packet_writer.cc ('k') | net/udp/datagram_server_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698