nl:: Inet:: UDPEndPoint
#include <src/inet/UDPEndPoint.h>
Bu sınıfın nesneleri UDP aktarımı uç noktalarını temsil eder.
Özet
Nest Inet Katman, UDP aktarım uç noktaları (Linux ve BSD ile türetilmiş sistemlerde SOCK_DGRAM yuvaları) veya LwIP UDP protokolü kontrol bloklarıyla (sistemin buna göre yapılandırıldığından) etkileşime geçme yöntemlerini içerir.
Devralma
Devralındığı kaynak: nl::Inet::IPEndPointBasis
Kamu işlevleri |
|
---|---|
Bind(IPAddressType addrType, IPAddress addr, uint16_t port, InterfaceId intfId)
|
Uç noktayı arayüz IP adresine bağlayın.
|
BindInterface(IPAddressType addrType, InterfaceId intf)
|
Uç noktayı bir ağ arayüzüne bağlayın.
|
Close(void)
|
void
Uç noktayı kapatın.
|
Free(void)
|
void
Uç noktayı kapatın ve belleğini geri dönüştürün.
|
GetBoundInterface(void)
|
InterfaceId
Bu uç noktadaki bağlı arayüzü alın.
|
GetBoundPort(void)
|
uint16_t
|
Listen(void)
|
Uç noktayı UDP mesajlarını alacak şekilde hazırlayın.
|
SendMsg(const IPPacketInfo *pktInfo, Weave::System::PacketBuffer *msg, uint16_t sendFlags)
|
Belirli bir hedefe UDP mesajı gönderir.
|
SendTo(IPAddress addr, uint16_t port, Weave::System::PacketBuffer *msg, uint16_t sendFlags)
|
SendTo(addr, port, INET_NULL_INTERFACEID, msg, sendFlags) ile eş anlamlı. |
SendTo(IPAddress addr, uint16_t port, InterfaceId intfId, Weave::System::PacketBuffer *msg, uint16_t sendFlags)
|
Belirtilen hedef adrese bir UDP mesajı gönderin.
|
Kamu işlevleri
Bağla
INET_ERROR Bind( IPAddressType addrType, IPAddress addr, uint16_t port, InterfaceId intfId )
Uç noktayı arayüz IP adresine bağlayın.
Uç noktayı belirtilen ağ arayüzü IP adresine bağlar.
Ayrıntılar | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parametreler |
|
||||||||||||||
Döndürülen Değerler |
|
LwIP'de bu yöntem, halihazırda alınmış LwIP yığın kilidiyle çağrılmamalıdır.
BindInterface
INET_ERROR BindInterface( IPAddressType addrType, InterfaceId intf )
Uç noktayı bir ağ arayüzüne bağlayın.
Uç noktayı belirtilen ağ arayüzü IP adresine bağlar.
Ayrıntılar | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parametreler |
|
||||||||||
Döndürülen Değerler |
|
LwIP'de bu yöntem, halihazırda alınmış LwIP yığın kilidiyle çağrılmamalıdır.
Kapat
void Close( void )
Uç noktayı kapatın.
mState != kState_Closed
ise uç noktayı kapatır ve bunu iletişim etkinliklerine uygun uç nokta grubundan kaldırır.
LwIP sistemlerinde bu yöntem, halihazırda edinilmiş LwIP yığın kilidiyle çağrılmamalıdır.
Ücretsiz
void Free( void )
Uç noktayı kapatın ve belleğini geri dönüştürün.
Close
yöntemini çağırır, ardından nesneyi bellek havuzuna döndürmek için InetLayerBasis::Release
yöntemini çağırır.
LwIP sistemlerinde bu yöntem, halihazırda edinilmiş LwIP yığın kilidiyle çağrılmamalıdır.
GetBoundInterface
InterfaceId GetBoundInterface( void )
Bu uç noktadaki bağlı arayüzü alın.
Ayrıntılar | |
---|---|
İadeler |
InterfaceId Bağlanmış arayüz kimliği.
|
GetBoundPort
uint16_t GetBoundPort( void )
Dinle
INET_ERROR Listen( void )
Uç noktayı UDP mesajlarını alacak şekilde hazırlayın.
State
zaten kState_Listening
ise herhangi bir işlem gerçekleştirilmez. Aksi takdirde mState
, kState_Listening
olarak ayarlanır ve uç nokta, platformun anlamına göre UDP mesajlarını almaya hazır olur.
Ayrıntılar | |||||
---|---|---|---|---|---|
Döndürülen Değerler |
|
LwIP'de bu yöntem, önceden alınmış LwIP yığın kilidiyle çağrılmamalıdır
SendMsg
INET_ERROR SendMsg( const IPPacketInfo *pktInfo, Weave::System::PacketBuffer *msg, uint16_t sendFlags )
Belirli bir hedefe UDP mesajı gönderir.
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.
Ayrıntılar | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parametreler |
|
||||||||||||
Döndürülen Değerler |
|
SendTo
INET_ERROR SendTo( IPAddress addr, uint16_t port, Weave::System::PacketBuffer *msg, uint16_t sendFlags )
SendTo(addr, port, INET_NULL_INTERFACEID, msg, sendFlags)
ile eş anlamlı.
SendTo
INET_ERROR SendTo( IPAddress addr, uint16_t port, InterfaceId intfId, Weave::System::PacketBuffer *msg, uint16_t sendFlags )
Belirtilen hedef adrese bir UDP mesajı gönderin.
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.
Ayrıntılar | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parametreler |
|
||||||||||||
Döndürülen Değerler |
|