summaryrefslogtreecommitdiffstats
path: root/ppapi/cpp/udp_socket.h
diff options
context:
space:
mode:
authoreduardo.lima <eduardo.lima@intel.com>2015-03-13 08:40:21 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-13 15:41:01 +0000
commit8171d46410b1ea937b0ae59577b9b36ed151149a (patch)
tree24bb98ab89f255ac337f9d584de264f931570bf3 /ppapi/cpp/udp_socket.h
parentfe37dca5b311cf194493669f26ddee27d60cc667 (diff)
downloadchromium_src-8171d46410b1ea937b0ae59577b9b36ed151149a.zip
chromium_src-8171d46410b1ea937b0ae59577b9b36ed151149a.tar.gz
chromium_src-8171d46410b1ea937b0ae59577b9b36ed151149a.tar.bz2
Add support for multicast in PPB_UDPSocket API
This change introduces two new values to be used with SetOption(), to set up the behavior of the multicast packets: - PP_UDPSOCKET_OPTION_MULTICAST_LOOP (Boolean) Whether packets sent from the host to the multicast group will be looped back to the host or not. - PP_UDPSOCKET_OPTION_MULTICAST_TTL (Integer) Sets time-to-live of multicast packets sent to the multicast group. It also introduces two new functions JoinGroup() and LeaveGroup(), both of them expecting the address of the multicast group as specified by the PPB_NetAddress API. These two functions should only be called after the socket is bound. This CL adds specific test cases to browser_tests in order to exercise the different versions of the SetOption function. For this reason, the PPAPI UDPSocket tests were split into multiple tests, instead of a single one that enclosed all of them. This way we get clearer information about the results of each test. BUG=430939 TEST=browser_tests NOPRESUBMIT=true Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com> Review URL: https://codereview.chromium.org/704133005 Cr-Commit-Position: refs/heads/master@{#320504}
Diffstat (limited to 'ppapi/cpp/udp_socket.h')
-rw-r--r--ppapi/cpp/udp_socket.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/ppapi/cpp/udp_socket.h b/ppapi/cpp/udp_socket.h
index 707c621..69e906f 100644
--- a/ppapi/cpp/udp_socket.h
+++ b/ppapi/cpp/udp_socket.h
@@ -156,6 +156,30 @@ class UDPSocket : public Resource {
int32_t SetOption(PP_UDPSocket_Option name,
const Var& value,
const CompletionCallback& callback);
+
+ /// Joins the multicast group with address specified by <code>group</code>
+ /// parameter, which is expected to be a <code>NetAddress</code> object.
+ ///
+ /// @param[in] group A <code>NetAddress</code> corresponding to the network
+ /// address of the multicast group.
+ /// @param[in] callback A <code>CompletionCallback</code> to be called upon
+ /// completion.
+ ///
+ /// @return An int32_t containing an error code from <code>pp_errors.h</code>.
+ int32_t JoinGroup(const NetAddress& group,
+ const CompletionCallback callback);
+
+ /// Leaves the multicast group with address specified by <code>group</code>
+ /// parameter, which is expected to be a <code>NetAddress</code> object.
+ ///
+ /// @param[in] group A <code>NetAddress</code> corresponding to the network
+ /// address of the multicast group.
+ /// @param[in] callback A <code>CompletionCallback</code> to be called upon
+ /// completion.
+ ///
+ /// @return An int32_t containing an error code from <code>pp_errors.h</code>.
+ int32_t LeaveGroup(const NetAddress& group,
+ const CompletionCallback callback);
};
} // namespace pp