nl :: Inet :: UDPEndPoint
#include <src/inet/UDPEndPoint.h>
Los objetos de esta clase representan puntos finales de transporte UDP.
Resumen
Nest Inet Layer encapsula métodos para interactuar con puntos finales de transporte UDP (sockets SOCK_DGRAM en Linux y sistemas derivados de BSD) o bloques de control del protocolo LwIP UDP, ya que el sistema está configurado en consecuencia.
Herencia
Hereda de: nl :: :: Inet IPEndPointBasisFunciones publicas | |
---|---|
Bind (IPAddressType addrType, IPAddress addr, uint16_t port, InterfaceId intfId) | Vincule el punto final a una dirección IP de interfaz. |
BindInterface (IPAddressType addrType, InterfaceId intf) | Vincular el punto final a una interfaz de red. |
Close (void) | void Cierre el punto final. |
Free (void) | void Cierre el endpoint y recicle su memoria. |
GetBoundInterface (void) | InterfaceId Obtenga la interfaz enlazada en este punto final. |
GetBoundPort (void) | uint16_t |
Listen (void) | Prepare el punto final para recibir mensajes UDP. |
SendMsg (const IPPacketInfo *pktInfo, Weave::System::PacketBuffer *msg, uint16_t sendFlags) | Envíe un mensaje UDP a un destino específico. |
SendTo ( IPAddress addr, uint16_t port, Weave::System::PacketBuffer *msg, uint16_t sendFlags) | Un sinónimo de SendTo(addr, port, INET_NULL_INTERFACEID, msg, sendFlags) . |
SendTo ( IPAddress addr, uint16_t port, InterfaceId intfId, Weave::System::PacketBuffer *msg, uint16_t sendFlags) | Envíe un mensaje UDP a la dirección de destino especificada. |
Funciones publicas
Unir
INET_ERROR Bind( IPAddressType addrType, IPAddress addr, uint16_t port, InterfaceId intfId )
Vincule el punto final a una dirección IP de interfaz.
Vincula el punto final a la dirección IP de la interfaz de red especificada.
Detalles | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parámetros |
| ||||||||||||||
Valores devueltos |
|
En LwIP, este método no debe llamarse con el bloqueo de pila LwIP ya adquirido.
BindInterface
INET_ERROR BindInterface( IPAddressType addrType, InterfaceId intf )
Vincular el punto final a una interfaz de red.
Vincula el punto final a la dirección IP de la interfaz de red especificada.
Detalles | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parámetros |
| ||||||||||
Valores devueltos |
|
En LwIP, este método no debe llamarse con el bloqueo de pila LwIP ya adquirido.
Cerca
void Close( void )
Cierre el punto final.
Si mState != kState_Closed
, a continuación, cierra el punto final, de sacarlo del conjunto de puntos finales que pueden optar a los eventos de comunicación.
En sistemas LwIP, este método no debe llamarse con el bloqueo de pila LwIP ya adquirido.
Libre
void Free( void )
Cierre el endpoint y recicle su memoria.
Invoca el Close
método, a continuación, invoca el InetLayerBasis::Release
método para devolver el objeto a su banco de memoria.
En los sistemas LwIP, este método no debe llamarse con el bloqueo de pila LwIP ya adquirido.
GetBoundInterface
InterfaceId GetBoundInterface( void )
Obtenga la interfaz enlazada en este punto final.
Detalles | |
---|---|
Devoluciones | InterfaceId El ID de la interfaz enlazada. |
GetBoundPort
uint16_t GetBoundPort( void )
Escuchar
INET_ERROR Listen( void )
Prepare el punto final para recibir mensajes UDP.
Si State
ya está kState_Listening
, entonces ninguna operación se realiza, de lo contrario el mState
se establece en kState_Listening
y el punto final se prepara a los mensajes UDP recibidos, de acuerdo con la semántica de la plataforma.
Detalles | |||||
---|---|---|---|---|---|
Valores devueltos |
|
En LwIP, este método no debe llamarse con el bloqueo de pila LwIP ya adquirido
SendMsg
INET_ERROR SendMsg( const IPPacketInfo *pktInfo, Weave::System::PacketBuffer *msg, uint16_t sendFlags )
Envíe un mensaje UDP a un destino específico.
Send the UDP message in \c msg to the destination address and port given in \c pktInfo. If \c pktInfo contains an interface id, the message will be sent over the specified interface. If \c pktInfo contains a source address, the given address will be used as the source of the UDP message. Where (sendFlags & kSendFlag_RetainBuffer) != 0, calls Weave::System::PacketBuffer::Free on behalf of the caller, otherwise this method deep-copies \c msg into a fresh object, and queues that for transmission, leaving the original \c msg available after return.
Detalles | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parámetros |
| ||||||||||||
Valores devueltos |
|
Enviar a
INET_ERROR SendTo( IPAddress addr, uint16_t port, Weave::System::PacketBuffer *msg, uint16_t sendFlags )
Un sinónimo de SendTo(addr, port, INET_NULL_INTERFACEID, msg, sendFlags)
.
Enviar a
INET_ERROR SendTo( IPAddress addr, uint16_t port, InterfaceId intfId, Weave::System::PacketBuffer *msg, uint16_t sendFlags )
Envíe un mensaje UDP a la dirección de destino especificada.
If possible, then this method sends the UDP message \c msg to the destination \c addr (with \c intfId used as the scope identifier for IPv6 link-local destinations) and \c port with the transmit option flags encoded in \c sendFlags. Where (sendFlags & kSendFlag_RetainBuffer) != 0, calls Weave::System::PacketBuffer::Free on behalf of the caller, otherwise this method deep-copies \c msg into a fresh object, and queues that for transmission, leaving the original \c msg available after return.
Detalles | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parámetros |
| ||||||||||||
Valores devueltos |
|