blob: 34e06a906a0970a06beeb970b3618cde5711a1ca [file] [log] [blame]
// Copyright (c) 2012 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.
#include "ppapi/c/pp_stdint.h"
#include "ppapi/c/private/ppb_udp_socket_private.h"
#include "ppapi/cpp/resource.h"
namespace pp {
class CompletionCallback;
class InstanceHandle;
class Var;
class UDPSocketPrivate : public Resource {
explicit UDPSocketPrivate(const InstanceHandle& instance);
// Returns true if the required interface is available.
static bool IsAvailable();
int32_t SetSocketFeature(PP_UDPSocketFeature_Private name, const Var& value);
int32_t Bind(const PP_NetAddress_Private* addr,
const CompletionCallback& callback);
bool GetBoundAddress(PP_NetAddress_Private* addr);
int32_t RecvFrom(char* buffer,
int32_t num_bytes,
const CompletionCallback& callback);
bool GetRecvFromAddress(PP_NetAddress_Private* addr);
int32_t SendTo(const char* buffer,
int32_t num_bytes,
const PP_NetAddress_Private* addr,
const CompletionCallback& callback);
void Close();
} // namespace pp