summaryrefslogtreecommitdiffstats
path: root/net/udp/udp_client_socket.h
diff options
context:
space:
mode:
authormbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-02 22:56:18 +0000
committermbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-02 22:56:18 +0000
commita2798d9808595a3b9d3a3b5fe6a3d0109a13aabd (patch)
tree50b849bc622aa4825f4eff165a655778678ccf84 /net/udp/udp_client_socket.h
parent4b9baf9d5a55852ab9613a04d745e891a6d083f0 (diff)
downloadchromium_src-a2798d9808595a3b9d3a3b5fe6a3d0109a13aabd.zip
chromium_src-a2798d9808595a3b9d3a3b5fe6a3d0109a13aabd.tar.gz
chromium_src-a2798d9808595a3b9d3a3b5fe6a3d0109a13aabd.tar.bz2
Add an initial API and implementation for UDP Sockets.
BUG=none TEST=none Review URL: http://codereview.chromium.org/6597039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76644 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/udp/udp_client_socket.h')
-rw-r--r--net/udp/udp_client_socket.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/net/udp/udp_client_socket.h b/net/udp/udp_client_socket.h
new file mode 100644
index 0000000..8ba07e5
--- /dev/null
+++ b/net/udp/udp_client_socket.h
@@ -0,0 +1,41 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_SOCKET_UDP_CLIENT_SOCKET_H_
+#define NET_SOCKET_UDP_CLIENT_SOCKET_H_
+#pragma once
+
+#include "net/base/net_log.h"
+#include "net/udp/datagram_client_socket.h"
+#include "net/udp/udp_socket.h"
+
+namespace net {
+
+class BoundNetLog;
+
+// A client socket that uses UDP as the transport layer.
+class UDPClientSocket : public DatagramClientSocket {
+ public:
+ UDPClientSocket(net::NetLog* net_log,
+ const net::NetLog::Source& source);
+ virtual ~UDPClientSocket();
+
+ // Implement DatagramClientSocket:
+ virtual int Connect(const AddressList& address);
+ virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback);
+ virtual int Write(IOBuffer* buf, int buf_len, CompletionCallback* callback);
+ virtual void Close();
+ virtual int GetPeerAddress(AddressList* address) const;
+ virtual int GetLocalAddress(AddressList* address) const;
+ virtual bool SetReceiveBufferSize(int32 size) { return true; }
+ virtual bool SetSendBufferSize(int32 size) { return true; }
+
+ private:
+ UDPSocket socket_;
+ DISALLOW_COPY_AND_ASSIGN(UDPClientSocket);
+};
+
+} // namespace net
+
+#endif // NET_SOCKET_UDP_CLIENT_SOCKET_H_