nl:: Inet:: UDPEndPoint
#include <src/inet/UDPEndPoint.h>
ออบเจ็กต์ของคลาสนี้แสดงปลายทางการรับส่ง UDP
สรุป
Nest Inet Layer สรุปวิธีการโต้ตอบกับปลายทางการส่ง UDP (ซ็อกเก็ต SOCK_DGRAM ใน Linux และระบบ BSD) หรือบล็อกควบคุมโปรโตคอล LwIP UDP เมื่อระบบได้รับการกำหนดค่าตามนั้น
การสืบทอด
รับค่าจาก nl::Inet::IPEndPointBasis
ฟังก์ชันสาธารณะ |
|
---|---|
Bind(IPAddressType addrType, IPAddress addr, uint16_t port, InterfaceId intfId)
|
เชื่อมโยงปลายทางกับที่อยู่ IP ของอินเทอร์เฟซ
|
BindInterface(IPAddressType addrType, InterfaceId intf)
|
เชื่อมโยงปลายทางกับอินเทอร์เฟซเครือข่าย
|
Close(void)
|
void
ปิดปลายทาง
|
Free(void)
|
void
ปิดปลายทางและนำหน่วยความจำกลับมาใช้ใหม่
|
GetBoundInterface(void)
|
InterfaceId
รับอินเทอร์เฟซที่เชื่อมโยงในปลายทางนี้
|
GetBoundPort(void)
|
uint16_t
|
Listen(void)
|
เตรียมปลายทางเพื่อรับข้อความ UDP
|
SendMsg(const IPPacketInfo *pktInfo, Weave::System::PacketBuffer *msg, uint16_t sendFlags)
|
ส่งข้อความ UDP ไปยังปลายทางที่ระบุ
|
SendTo(IPAddress addr, uint16_t port, Weave::System::PacketBuffer *msg, uint16_t sendFlags)
|
คำพ้องของ
SendTo(addr, port, INET_NULL_INTERFACEID, msg, sendFlags) |
SendTo(IPAddress addr, uint16_t port, InterfaceId intfId, Weave::System::PacketBuffer *msg, uint16_t sendFlags)
|
ส่งข้อความ UDP ไปยังที่อยู่ปลายทางที่ระบุ
|
ฟังก์ชันสาธารณะ
เชื่อมโยง
INET_ERROR Bind( IPAddressType addrType, IPAddress addr, uint16_t port, InterfaceId intfId )
เชื่อมโยงปลายทางกับที่อยู่ IP ของอินเทอร์เฟซ
เชื่อมโยงปลายทางกับที่อยู่ IP ของอินเทอร์เฟซเครือข่ายที่ระบุ
รายละเอียด | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
พารามิเตอร์ |
|
||||||||||||||
แสดงผลค่า |
|
ใน LwIP ต้องไม่เรียกเมธอดนี้เมื่อได้มาซึ่งสแต็กล็อก LwIP แล้ว
BindInterface
INET_ERROR BindInterface( IPAddressType addrType, InterfaceId intf )
เชื่อมโยงปลายทางกับอินเทอร์เฟซเครือข่าย
เชื่อมโยงปลายทางกับที่อยู่ IP ของอินเทอร์เฟซเครือข่ายที่ระบุ
รายละเอียด | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
พารามิเตอร์ |
|
||||||||||
แสดงผลค่า |
|
ใน LwIP ต้องไม่เรียกเมธอดนี้เมื่อได้มาซึ่งสแต็กล็อก LwIP แล้ว
ปิด
void Close( void )
ปิดปลายทาง
หากเป็น mState != kState_Closed
ระบบจะปิดใช้ปลายทางดังกล่าวโดยนำออกจากชุดปลายทางที่มีสิทธิ์สำหรับเหตุการณ์การสื่อสาร
ในระบบ LwIP ต้องไม่เรียกใช้เมธอดนี้เมื่อได้รับสแต็กล็อก LwIP แล้ว
ฟรี
void Free( void )
ปิดปลายทางและนำหน่วยความจำกลับมาใช้ใหม่
เรียกใช้เมธอด Close
จากนั้นเรียกใช้เมธอด InetLayerBasis::Release
เพื่อส่งกลับออบเจ็กต์ไปยังพูลหน่วยความจำ
ในระบบ LwIP ต้องไม่เรียกใช้เมธอดนี้เมื่อได้รับสแต็กล็อก LwIP แล้ว
GetBoundInterface
InterfaceId GetBoundInterface( void )
รับอินเทอร์เฟซที่เชื่อมโยงในปลายทางนี้
รายละเอียด | |
---|---|
การส่งคืน |
InterfaceId รหัสอินเทอร์เฟซที่เชื่อมโยง
|
GetBoundPort
uint16_t GetBoundPort( void )
ฟัง
INET_ERROR Listen( void )
เตรียมปลายทางเพื่อรับข้อความ UDP
หาก State
เป็น kState_Listening
อยู่แล้ว ก็จะไม่มีการดำเนินการใดๆ มิเช่นนั้นระบบจะตั้งค่า mState
เป็น kState_Listening
และปลายทางจะได้รับการเตรียมรับข้อความ UDP ตามความหมายของแพลตฟอร์ม
รายละเอียด | |||||
---|---|---|---|---|---|
แสดงผลค่า |
|
ใน LwIP ต้องไม่เรียกเมธอดนี้เมื่อได้มาซึ่งสแต็กล็อก LwIP แล้ว
SendMsg
INET_ERROR SendMsg( const IPPacketInfo *pktInfo, Weave::System::PacketBuffer *msg, uint16_t sendFlags )
ส่งข้อความ UDP ไปยังปลายทางที่ระบุ
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.
รายละเอียด | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
พารามิเตอร์ |
|
||||||||||||
แสดงผลค่า |
|
SendTo
INET_ERROR SendTo( IPAddress addr, uint16_t port, Weave::System::PacketBuffer *msg, uint16_t sendFlags )
คำพ้องของ 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 )
ส่งข้อความ UDP ไปยังที่อยู่ปลายทางที่ระบุ
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.
รายละเอียด | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
พารามิเตอร์ |
|
||||||||||||
แสดงผลค่า |
|