nl:: Inet:: UDPEndPoint
#include <src/inet/UDPEndPoint.h>
Objek dari class ini mewakili endpoint transpor UDP.
Ringkasan
Nest Inet Layer mengenkapsulasi metode untuk berinteraksi dengan endpoint transpor UDP (soket SOCK_DGRAM pada sistem yang berasal dari Linux dan BSD) atau blok kontrol protokol LwIP UDP, sesuai dengan konfigurasi sistem yang sesuai.
Inheritance
Mewarisi dari: nl::Inet::IPEndPointBasis
Fungsi publik |
|
---|---|
Bind(IPAddressType addrType, IPAddress addr, uint16_t port, InterfaceId intfId)
|
Ikat endpoint ke alamat IP antarmuka.
|
BindInterface(IPAddressType addrType, InterfaceId intf)
|
Ikat endpoint ke antarmuka jaringan.
|
Close(void)
|
void
Tutup endpoint.
|
Free(void)
|
void
Tutup endpoint dan daur ulang memorinya.
|
GetBoundInterface(void)
|
InterfaceId
Mendapatkan antarmuka terikat pada endpoint ini.
|
GetBoundPort(void)
|
uint16_t
|
Listen(void)
|
Siapkan endpoint untuk menerima pesan UDP.
|
SendMsg(const IPPacketInfo *pktInfo, Weave::System::PacketBuffer *msg, uint16_t sendFlags)
|
Mengirim pesan UDP ke tujuan yang ditentukan.
|
SendTo(IPAddress addr, uint16_t port, Weave::System::PacketBuffer *msg, uint16_t sendFlags)
|
Sinonim untuk
SendTo(addr, port, INET_NULL_INTERFACEID, msg, sendFlags) . |
SendTo(IPAddress addr, uint16_t port, InterfaceId intfId, Weave::System::PacketBuffer *msg, uint16_t sendFlags)
|
Mengirim pesan UDP ke alamat tujuan yang ditentukan.
|
Fungsi publik
Ikat
INET_ERROR Bind( IPAddressType addrType, IPAddress addr, uint16_t port, InterfaceId intfId )
Ikat endpoint ke alamat IP antarmuka.
Mengikat endpoint ke alamat IP antarmuka jaringan yang ditentukan.
Detail | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameter |
|
||||||||||||||
Nilai Pengembalian |
|
Di LwIP, metode ini tidak boleh dipanggil dengan kunci stack LwIP yang sudah diperoleh.
BindInterface
INET_ERROR BindInterface( IPAddressType addrType, InterfaceId intf )
Ikat endpoint ke antarmuka jaringan.
Mengikat endpoint ke alamat IP antarmuka jaringan yang ditentukan.
Detail | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parameter |
|
||||||||||
Nilai Pengembalian |
|
Di LwIP, metode ini tidak boleh dipanggil dengan kunci stack LwIP yang sudah diperoleh.
Tutup
void Close( void )
Tutup endpoint.
Jika mState != kState_Closed
, endpoint akan ditutup, dan menghapusnya dari kumpulan endpoint yang memenuhi syarat untuk peristiwa komunikasi.
Pada sistem LwIP, metode ini tidak boleh dipanggil dengan penguncian stack LwIP yang sudah diperoleh.
Gratis
void Free( void )
Tutup endpoint dan daur ulang memorinya.
Memanggil metode Close
, lalu memanggil metode InetLayerBasis::Release
untuk menampilkan objek ke kumpulan memorinya.
Pada sistem LwIP, metode ini tidak boleh dipanggil dengan penguncian stack LwIP yang sudah diperoleh.
GetBoundInterface
InterfaceId GetBoundInterface( void )
Mendapatkan antarmuka terikat pada endpoint ini.
Detail | |
---|---|
Hasil |
InterfaceId ID antarmuka terikat.
|
GetBoundPort
uint16_t GetBoundPort( void )
Dengarkan
INET_ERROR Listen( void )
Siapkan endpoint untuk menerima pesan UDP.
Jika State
sudah kState_Listening
, tidak ada operasi yang akan dijalankan. Jika tidak, mState
akan disetel ke kState_Listening
dan endpoint disiapkan untuk menerima pesan UDP, sesuai dengan semantik platform.
Detail | |||||
---|---|---|---|---|---|
Nilai Pengembalian |
|
Di LwIP, metode ini tidak boleh dipanggil dengan kunci stack LwIP yang sudah diperoleh
SendMsg
INET_ERROR SendMsg( const IPPacketInfo *pktInfo, Weave::System::PacketBuffer *msg, uint16_t sendFlags )
Mengirim pesan UDP ke tujuan yang ditentukan.
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.
Detail | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameter |
|
||||||||||||
Nilai Pengembalian |
|
SendTo
INET_ERROR SendTo( IPAddress addr, uint16_t port, Weave::System::PacketBuffer *msg, uint16_t sendFlags )
Sinonim untuk SendTo(addr, port, INET_NULL_INTERFACEID, msg, sendFlags)
.
SendTo
INET_ERROR SendTo( IPAddress addr, uint16_t port, InterfaceId intfId, Weave::System::PacketBuffer *msg, uint16_t sendFlags )
Mengirim pesan UDP ke alamat tujuan yang ditentukan.
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.
Detail | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameter |
|
||||||||||||
Nilai Pengembalian |
|