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

Unified Diff: native_client_sdk/src/libraries/nacl_io/mount_node_udp.h

Issue 22587003: [NaCl SDK] Add UDP and TCP Sockets (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to browser tester fix. Created 7 years, 4 months 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 side-by-side diff with in-line comments
Download patch
Index: native_client_sdk/src/libraries/nacl_io/mount_node_udp.h
diff --git a/native_client_sdk/src/libraries/nacl_io/mount_node_udp.h b/native_client_sdk/src/libraries/nacl_io/mount_node_udp.h
new file mode 100644
index 0000000000000000000000000000000000000000..ac095f1760fd08ced10c5cd31f0e93f9de3a017f
--- /dev/null
+++ b/native_client_sdk/src/libraries/nacl_io/mount_node_udp.h
@@ -0,0 +1,64 @@
+// Copyright (c) 2013 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 LIBRARIES_NACL_IO_MOUNT_NODE_UDP_H_
+#define LIBRARIES_NACL_IO_MOUNT_NODE_UDP_H_
+
+#include "nacl_io/ossocket.h"
+#ifdef PROVIDES_SOCKET_API
+
+#include <ppapi/c/pp_resource.h>
+#include <ppapi/c/ppb_udp_socket.h>
+
+#include "nacl_io/mount_node.h"
+#include "nacl_io/mount_node_socket.h"
+
+namespace nacl_io {
+
+class MountNodeUDP : public MountNodeSocket {
+ public:
+ explicit MountNodeUDP(Mount* mount);
+
+ virtual Error Init(int flags);
+
+ virtual Error Bind(const struct sockaddr* addr, socklen_t len);
+ virtual Error Connect(const struct sockaddr* addr, socklen_t len);
+
+ virtual Error Recv(void* buf, size_t len, int flags, int* out_len);
+ virtual Error RecvFrom(void* buf,
+ size_t len,
+ int flags,
+ struct sockaddr* src_addr,
+ socklen_t* addrlen,
+ int* out_len);
+
+ virtual Error Send(const void* buf, size_t len, int flags, int* out_len);
+ virtual Error SendTo(const void* buf,
+ size_t len,
+ int flags,
+ const struct sockaddr* dest_addr,
+ socklen_t addrlen,
+ int* out_len);
+
+ protected:
+ UDPSocketInterface* UDPSocket();
+
+ Error RecvFromHelper(void* buf,
+ size_t len,
+ int flags,
+ PP_Resource* addr,
+ int* out_len);
+
+ Error SendToHelper(const void* buf,
+ size_t len,
+ int flags,
+ PP_Resource dest_addr,
+ int* out_len);
+};
+
+
+} // namespace nacl_io
+
+#endif // PROVIDES_SOCKET_API
+#endif // LIBRARIES_NACL_IO_MOUNT_NODE_UDP_H_
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/mount_node_tcp.cc ('k') | native_client_sdk/src/libraries/nacl_io/mount_node_udp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698