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

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

Issue 1327923002: Migrates QUIC sessions to a new network when old network is (about to be) disconnected. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@home
Patch Set: Fixes and responses to outstanding comments Created 5 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
OLDNEW
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 "net/base/rand_callback.h" 8 #include "net/base/rand_callback.h"
9 #include "net/log/net_log.h" 9 #include "net/log/net_log.h"
10 #include "net/udp/datagram_client_socket.h" 10 #include "net/udp/datagram_client_socket.h"
11 #include "net/udp/udp_socket.h" 11 #include "net/udp/udp_socket.h"
12 12
13 namespace net { 13 namespace net {
14 14
15 class BoundNetLog; 15 class BoundNetLog;
16 16
17 // A client socket that uses UDP as the transport layer. 17 // A client socket that uses UDP as the transport layer.
18 class NET_EXPORT_PRIVATE UDPClientSocket : public DatagramClientSocket { 18 class NET_EXPORT_PRIVATE UDPClientSocket : public DatagramClientSocket {
19 public: 19 public:
20 UDPClientSocket(DatagramSocket::BindType bind_type, 20 UDPClientSocket(DatagramSocket::BindType bind_type,
21 const RandIntCallback& rand_int_cb, 21 const RandIntCallback& rand_int_cb,
22 net::NetLog* net_log, 22 net::NetLog* net_log,
23 const net::NetLog::Source& source); 23 const net::NetLog::Source& source);
24 ~UDPClientSocket() override; 24 ~UDPClientSocket() override;
25 25
26 // DatagramClientSocket implementation. 26 // DatagramClientSocket implementation.
27 int BindToNetwork(NetworkChangeNotifier::NetworkHandle network) override; 27 int BindToNetwork(NetworkChangeNotifier::NetworkHandle network) override;
28 int BindToDefaultNetwork() override;
28 int Connect(const IPEndPoint& address) override; 29 int Connect(const IPEndPoint& address) override;
29 int Read(IOBuffer* buf, 30 int Read(IOBuffer* buf,
30 int buf_len, 31 int buf_len,
31 const CompletionCallback& callback) override; 32 const CompletionCallback& callback) override;
32 int Write(IOBuffer* buf, 33 int Write(IOBuffer* buf,
33 int buf_len, 34 int buf_len,
34 const CompletionCallback& callback) override; 35 const CompletionCallback& callback) override;
35 void Close() override; 36 void Close() override;
36 int GetPeerAddress(IPEndPoint* address) const override; 37 int GetPeerAddress(IPEndPoint* address) const override;
37 int GetLocalAddress(IPEndPoint* address) const override; 38 int GetLocalAddress(IPEndPoint* address) const override;
38 int SetReceiveBufferSize(int32 size) override; 39 int SetReceiveBufferSize(int32 size) override;
39 int SetSendBufferSize(int32 size) override; 40 int SetSendBufferSize(int32 size) override;
40 const BoundNetLog& NetLog() const override; 41 const BoundNetLog& NetLog() const override;
41 42
42 #if defined(OS_WIN) 43 #if defined(OS_WIN)
43 // Switch to use non-blocking IO. Must be called right after construction and 44 // Switch to use non-blocking IO. Must be called right after construction and
44 // before other calls. 45 // before other calls.
45 void UseNonBlockingIO(); 46 void UseNonBlockingIO();
46 #endif 47 #endif
47 48
48 private: 49 private:
49 UDPSocket socket_; 50 UDPSocket socket_;
50 DISALLOW_COPY_AND_ASSIGN(UDPClientSocket); 51 DISALLOW_COPY_AND_ASSIGN(UDPClientSocket);
51 }; 52 };
52 53
53 } // namespace net 54 } // namespace net
54 55
55 #endif // NET_SOCKET_UDP_CLIENT_SOCKET_H_ 56 #endif // NET_SOCKET_UDP_CLIENT_SOCKET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698