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]
pub fn coerce<T: nsIUDPSocketCoerce>(&self) -> &T
[src]
Cast this nsIUDPSocket
to one of its base interfaces.
impl nsIUDPSocket
[src]
pub unsafe fn Close(&self) -> nsresult
[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 ();
pub unsafe fn AsyncListen(
&self,
aListener: *const nsIUDPSocketListener
) -> nsresult
[src]
&self,
aListener: *const nsIUDPSocketListener
) -> nsresult
/**
* 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);
pub unsafe fn GetLocalAddr(
&self,
aLocalAddr: *mut *const nsINetAddr
) -> nsresult
[src]
&self,
aLocalAddr: *mut *const nsINetAddr
) -> nsresult
/**
* Returns the local address of this UDP socket
*/
readonly attribute nsINetAddr localAddr;
pub unsafe fn GetPort(&self, aPort: *mut int32_t) -> nsresult
[src]
/**
* Returns the port of this UDP socket.
*/
readonly attribute long port;
pub unsafe fn Send(
&self,
host: &nsACString,
port: uint16_t,
data: *const uint8_t,
dataLength: uint32_t,
_retval: *mut uint32_t
) -> nsresult
[src]
&self,
host: &nsACString,
port: uint16_t,
data: *const uint8_t,
dataLength: uint32_t,
_retval: *mut uint32_t
) -> nsresult
/**
* 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);
pub unsafe fn SendWithAddr(
&self,
addr: *const nsINetAddr,
data: *const uint8_t,
dataLength: uint32_t,
_retval: *mut uint32_t
) -> nsresult
[src]
&self,
addr: *const nsINetAddr,
data: *const uint8_t,
dataLength: uint32_t,
_retval: *mut uint32_t
) -> nsresult
/**
* 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);
pub unsafe fn SendBinaryStream(
&self,
host: &nsACString,
port: uint16_t,
stream: *const nsIInputStream
) -> nsresult
[src]
&self,
host: &nsACString,
port: uint16_t,
stream: *const nsIInputStream
) -> nsresult
/**
* 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);
pub unsafe fn JoinMulticast(
&self,
addr: &nsACString,
iface: &nsACString
) -> nsresult
[src]
&self,
addr: &nsACString,
iface: &nsACString
) -> nsresult
/**
* 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);
pub unsafe fn LeaveMulticast(
&self,
addr: &nsACString,
iface: &nsACString
) -> nsresult
[src]
&self,
addr: &nsACString,
iface: &nsACString
) -> nsresult
/**
* 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);
pub unsafe fn GetMulticastLoopback(
&self,
aMulticastLoopback: *mut bool
) -> nsresult
[src]
&self,
aMulticastLoopback: *mut bool
) -> nsresult
/**
* 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;
pub unsafe fn SetMulticastLoopback(&self, aMulticastLoopback: bool) -> nsresult
[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;
pub unsafe fn GetMulticastInterface(
&self,
aMulticastInterface: &mut nsACString
) -> nsresult
[src]
&self,
aMulticastInterface: &mut nsACString
) -> nsresult
/**
* multicastInterface
*
* The interface that should be used for sending future multicast datagrams.
* Note: This is currently write-only.
*/
attribute AUTF8String multicastInterface;
pub unsafe fn SetMulticastInterface(
&self,
aMulticastInterface: &nsACString
) -> nsresult
[src]
&self,
aMulticastInterface: &nsACString
) -> nsresult
/**
* multicastInterface
*
* The interface that should be used for sending future multicast datagrams.
* Note: This is currently write-only.
*/
attribute AUTF8String multicastInterface;
pub unsafe fn GetRecvBufferSize(
&self,
aRecvBufferSize: *mut int32_t
) -> nsresult
[src]
&self,
aRecvBufferSize: *mut int32_t
) -> nsresult
/**
* recvBufferSize
*
* The size of the receive buffer. Default depends on the OS.
*/
[noscript] attribute long recvBufferSize;
pub unsafe fn SetRecvBufferSize(&self, aRecvBufferSize: int32_t) -> nsresult
[src]
/**
* recvBufferSize
*
* The size of the receive buffer. Default depends on the OS.
*/
[noscript] attribute long recvBufferSize;
pub unsafe fn GetSendBufferSize(
&self,
aSendBufferSize: *mut int32_t
) -> nsresult
[src]
&self,
aSendBufferSize: *mut int32_t
) -> nsresult
/**
* sendBufferSize
*
* The size of the send buffer. Default depends on the OS.
*/
[noscript] attribute long sendBufferSize;
pub unsafe fn SetSendBufferSize(&self, aSendBufferSize: int32_t) -> nsresult
[src]
/**
* sendBufferSize
*
* The size of the send buffer. Default depends on the OS.
*/
[noscript] attribute long sendBufferSize;
Methods from Deref<Target = nsISupports>
pub fn coerce<T: nsISupportsCoerce>(&self) -> &T
[src]
Cast this nsISupports
to one of its base interfaces.
pub unsafe fn QueryInterface(
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
[src]
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);
pub unsafe fn AddRef(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt AddRef ();
pub unsafe fn Release(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt Release ();
Trait Implementations
impl XpCom for nsIUDPSocket
[src]
const IID: nsIID
IID: nsIID = nsID(3559112526, 17561, 16591, [188, 3, 21, 62, 43, 242, 6, 209])
fn query_interface<T: XpCom>(&self) -> Option<RefPtr<T>>
[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]
unsafe fn addref(&self)
[src]
Increment the reference count.
unsafe fn release(&self)
[src]
Decrement the reference count, potentially freeing backing memory.
impl Deref for nsIUDPSocket
[src]
type Target = nsISupports
The resulting type after dereferencing.
fn deref(&self) -> &nsISupports
[src]
Dereferences the value.