[Android WebView] Fix webview perf bot switchover to use org.chromium.webview_shell...
[chromium-blink-merge.git] / net / udp / udp_client_socket.h
blob50a1b29d70957c6c29484de6eee8f0c380ec01ef
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.
5 #ifndef NET_SOCKET_UDP_CLIENT_SOCKET_H_
6 #define NET_SOCKET_UDP_CLIENT_SOCKET_H_
8 #include "net/base/rand_callback.h"
9 #include "net/log/net_log.h"
10 #include "net/udp/datagram_client_socket.h"
11 #include "net/udp/udp_socket.h"
13 namespace net {
15 class BoundNetLog;
17 // A client socket that uses UDP as the transport layer.
18 class NET_EXPORT_PRIVATE UDPClientSocket : public DatagramClientSocket {
19 public:
20 UDPClientSocket(DatagramSocket::BindType bind_type,
21 const RandIntCallback& rand_int_cb,
22 net::NetLog* net_log,
23 const net::NetLog::Source& source);
24 ~UDPClientSocket() override;
26 // DatagramClientSocket implementation.
27 int Connect(const IPEndPoint& address) override;
28 int Read(IOBuffer* buf,
29 int buf_len,
30 const CompletionCallback& callback) override;
31 int Write(IOBuffer* buf,
32 int buf_len,
33 const CompletionCallback& callback) override;
34 void Close() override;
35 int GetPeerAddress(IPEndPoint* address) const override;
36 int GetLocalAddress(IPEndPoint* address) const override;
37 int SetReceiveBufferSize(int32 size) override;
38 int SetSendBufferSize(int32 size) override;
39 const BoundNetLog& NetLog() const override;
41 #if defined(OS_WIN)
42 // Switch to use non-blocking IO. Must be called right after construction and
43 // before other calls.
44 void UseNonBlockingIO();
45 #endif
47 private:
48 UDPSocket socket_;
49 DISALLOW_COPY_AND_ASSIGN(UDPClientSocket);
52 } // namespace net
54 #endif // NET_SOCKET_UDP_CLIENT_SOCKET_H_