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.
التفاصيل | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
المَعلمات |
|
||||||||||||
قيم الإرجاع |
|