Struct xpcom::interfaces::nsIUDPSocket [] [src]

#[repr(C)]
pub struct nsIUDPSocket { /* fields omitted */ }

interface nsIUDPSocket : nsISupports

/**
 * nsIUDPSocket
 *
 * An interface to a UDP socket that can accept incoming connections.
 */

Methods

impl nsIUDPSocket
[src]

[src]

Cast this nsIUDPSocket to one of its base interfaces.

impl nsIUDPSocket
[src]

[src]

/**
     * close
     *
     * This method closes a UDP socket.  This does not affect already
     * connected client sockets (i.e., the nsISocketTransport instances
     * created from this UDP socket).  This will cause the onStopListening
     * event to asynchronously fire with a status of NS_BINDING_ABORTED.
     */

void close ();

[src]

/**
     * asyncListen
     *
     * This method puts the UDP socket in the listening state.  It will
     * asynchronously listen for and accept client connections.  The listener
     * will be notified once for each client connection that is accepted.  The
     * listener's onSocketAccepted method will be called on the same thread
     * that called asyncListen (the calling thread must have a nsIEventTarget).
     *
     * The listener will be passed a reference to an already connected socket
     * transport (nsISocketTransport).  See below for more details.
     *
     * @param aListener
     *        The listener to be notified when client connections are accepted.
     */

void asyncListen (in nsIUDPSocketListener aListener);

[src]

/**
     * Returns the local address of this UDP socket
     */

readonly attribute nsINetAddr localAddr;

[src]

/**
     * Returns the port of this UDP socket.
     */

readonly attribute long port;

[src]

/**
     * send
     *
     * Send out the datagram to specified remote host and port.
     * DNS lookup will be triggered.
     *
     * @param host The remote host name.
     * @param port The remote port.
     * @param data The buffer containing the data to be written.
     * @param dataLength The maximum number of bytes to be written.
     * @return number of bytes written. (0 or dataLength)
     */

unsigned long send (in AUTF8String host, in unsigned short port, [array, size_is (dataLength), const] in uint8_t data, in unsigned long dataLength);

[src]

/**
     * sendWithAddr
     *
     * Send out the datagram to specified remote host and port.
     *
     * @param addr The remote host address.
     * @param data The buffer containing the data to be written.
     * @param dataLength The maximum number of bytes to be written.
     * @return number of bytes written. (0 or dataLength)
     */

unsigned long sendWithAddr (in nsINetAddr addr, [array, size_is (dataLength), const] in uint8_t data, in unsigned long dataLength);

[src]

/**
     * sendBinaryStream
     *
     * Send out the datagram to specified remote address and port.
     *
     * @param host The remote host name.
     * @param port The remote port.
     * @param stream The input stream to be sent. This must be a buffered stream implementation.
     */

void sendBinaryStream (in AUTF8String host, in unsigned short port, in nsIInputStream stream);

[src]

/**
     * joinMulticast
     *
     * Join the multicast group specified by |addr|.  You are then able to
     * receive future datagrams addressed to the group.
     *
     * @param addr
     *        The multicast group address.
     * @param iface
     *        The local address of the interface on which to join the group.  If
     *        this is not specified, the OS may join the group on all interfaces
     *        or only the primary interface.
     */

void joinMulticast (in AUTF8String addr, [optional] in AUTF8String iface);

[src]

/**
     * leaveMulticast
     *
     * Leave the multicast group specified by |addr|.  You will no longer
     * receive future datagrams addressed to the group.
     *
     * @param addr
     *        The multicast group address.
     * @param iface
     *        The local address of the interface on which to leave the group.
     *        If this is not specified, the OS may leave the group on all
     *        interfaces or only the primary interface.
     */

void leaveMulticast (in AUTF8String addr, [optional] in AUTF8String iface);

[src]

/**
     * multicastLoopback
     *
     * Whether multicast datagrams sent via this socket should be looped back to
     * this host (assuming this host has joined the relevant group).  Defaults
     * to true.
     * Note: This is currently write-only.
     */

attribute boolean multicastLoopback;

[src]

/**
     * multicastLoopback
     *
     * Whether multicast datagrams sent via this socket should be looped back to
     * this host (assuming this host has joined the relevant group).  Defaults
     * to true.
     * Note: This is currently write-only.
     */

attribute boolean multicastLoopback;

[src]

/**
     * multicastInterface
     *
     * The interface that should be used for sending future multicast datagrams.
     * Note: This is currently write-only.
     */

attribute AUTF8String multicastInterface;

[src]

/**
     * multicastInterface
     *
     * The interface that should be used for sending future multicast datagrams.
     * Note: This is currently write-only.
     */

attribute AUTF8String multicastInterface;

[src]

/**
     * recvBufferSize
     *
     * The size of the receive buffer. Default depends on the OS.
     */

[noscript] attribute long recvBufferSize;

[src]

/**
     * recvBufferSize
     *
     * The size of the receive buffer. Default depends on the OS.
     */

[noscript] attribute long recvBufferSize;

[src]

/**
     * sendBufferSize
     *
     * The size of the send buffer. Default depends on the OS.
     */

[noscript] attribute long sendBufferSize;

[src]

/**
     * sendBufferSize
     *
     * The size of the send buffer. Default depends on the OS.
     */

[noscript] attribute long sendBufferSize;

Methods from Deref<Target = nsISupports>

[src]

Cast this nsISupports to one of its base interfaces.

[src]

void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);

[src]

[noscript,notxpcom] nsrefcnt AddRef ();

[src]

[noscript,notxpcom] nsrefcnt Release ();

Trait Implementations

impl XpCom for nsIUDPSocket
[src]

IID: nsIID = nsID(3559112526, 17561, 16591, [188, 3, 21, 62, 43, 242, 6, 209])

[src]

Perform a QueryInterface call on this object, attempting to dynamically cast it to the requested interface type. Returns Some(RefPtr) if the cast succeeded, and None otherwise. Read more

impl RefCounted for nsIUDPSocket
[src]

[src]

Increment the reference count.

[src]

Decrement the reference count, potentially freeing backing memory.

impl Deref for nsIUDPSocket
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.