nl:: Inet:: UDPEndPoint
#include <src/inet/UDPEndPoint.h>
אובייקטים מהמחלקה הזו מייצגים נקודות קצה להעברת UDP.
סיכום
בשכבת Inet Layer של Nest מתבצע אנקפסולציה של שיטות לאינטראקציה עם נקודות קצה להעברת UDP (שקעי SOCK_DGRAM במערכות Linux ו-BSD) או בלוקים לבקרת פרוטוקול UDP של LwIP, מאחר שהמערכת מוגדרת בהתאם.
ירושה
עוברות בירושה מ: 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 של הממשק.
מחייבת את נקודת הקצה (endpoint) עם כתובת ה-IP של ממשק הרשת שצוינה.
פרטים | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
פרמטרים |
|
||||||||||||||
ערכים מוחזרים |
|
ב-LwIP, אין להפעיל את השיטה הזו לאחר שנעילת המקבץ LwIP כבר נרכשה.
BindInterface
INET_ERROR BindInterface( IPAddressType addrType, InterfaceId intf )
קישור של נקודת הקצה לממשק רשת.
מחייבת את נקודת הקצה (endpoint) עם כתובת ה-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.
פרטים | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
פרמטרים |
|
||||||||||||
ערכים מוחזרים |
|