blob: 9e4cbf252c0e2025af44acc569bf5ef4f41d6e9d [file] [log] [blame]
// Copyright 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.
// The <code>chrome.webrtc.castUdpTransport</code> API creates a UDP
// transport for outer transport to send and receive data. This API is not
// useful when standalone since it does not have send and receive methods.
// It should be used as an inner transport for other transports such as
// castSendTransport.
namespace webrtc.castUdpTransport {
// The UDP socket address and port.
dictionary UdpParams {
DOMString address;
long port;
};
// Callback from the <code>create</code> method.
// |transportId| : The transport ID.
// A null value indicates an error.
callback CreateCallback = void (long transportId);
interface Functions {
// Creates a UDP transport.
// |callback| : Called when the transport has been created.
[nocompile] static void create(CreateCallback callback);
// Destroys a UDP transport.
// |transportId| : The transport ID.
[nocompile] static void destroy(long transportId);
// Starts to use the transport by providing remote UDP info.
// |transportId| : The transport ID.
// |remoteParams| : The address and port to send packets to.
[nocompile] static void start(long transportId, UdpParams remoteParams);
};
};