nl:: İnternet:: UDPEBitişNoktası
#include <src/inet/UDPEndPoint.h>
Bu sınıfın nesneleri, UDP aktarım uç noktalarını temsil eder.
Özet
Nest Inet Katmanı, sistem buna göre yapılandırıldığı için UDP aktarım uç noktaları (Linux ve BSD türevli sistemlerde SOCK_DGRAM soketleri) veya LwIP UDP protokolü kontrol bloklarıyla etkileşime girme yöntemlerini kapsar.
miras
: Den devralır nl :: Inet :: IPEndPointBasisKamu işlevleri | |
---|---|
Bind (IPAddressType addrType, IPAddress addr, uint16_t port, InterfaceId intfId) | Uç noktayı bir arabirim IP adresine bağlayın. |
BindInterface (IPAddressType addrType, InterfaceId intf) | Uç noktayı bir ağ arabirimine 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ç noktada bağlı arabirimi alın. |
GetBoundPort (void) | uint16_t |
Listen (void) | UDP mesajlarını almak için uç noktayı hazırlayın. |
SendMsg (const IPPacketInfo *pktInfo, Weave::System::PacketBuffer *msg, uint16_t sendFlags) | Belirtilen bir hedefe bir UDP mesajı gönderin. |
SendTo ( IPAddress addr, uint16_t port, Weave::System::PacketBuffer *msg, uint16_t sendFlags) | Eşanlamlıdır SendTo(addr, port, INET_NULL_INTERFACEID, msg, sendFlags) . |
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ı bir arabirim IP adresine bağlayın.
Uç noktayı belirtilen ağ arabirimi IP adresine bağlar.
Ayrıntılar | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parametreler |
| ||||||||||||||
Dönüş Değerleri |
|
LwIP'de, bu yöntem, önceden alınmış LwIP yığın kilidi ile çağrılmamalıdır.
BindInterface
INET_ERROR BindInterface( IPAddressType addrType, InterfaceId intf )
Uç noktayı bir ağ arabirimine bağlayın.
Uç noktayı belirtilen ağ arabirimi IP adresine bağlar.
Ayrıntılar | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
parametreler |
| ||||||||||
Dönüş Değerleri |
|
LwIP'de, bu yöntem, önceden alınmış LwIP yığın kilidi ile çağrılmamalıdır.
Kapat
void Close( void )
Uç noktayı kapatın.
Eğer mState != kState_Closed
ardından iletişim olaylar için uygun uç noktaları kümesinden çıkarmadan, bitiş noktası kapatır.
LwIP sistemlerinde, bu yöntem, önceden alınmış LwIP yığın kilidi ile çağrılmamalıdır.
Bedava
void Free( void )
Uç noktayı kapatın ve belleğini geri dönüştürün.
Çağırır Close
yöntemle, daha sonra çağıran InetLayerBasis::Release
bellek havuzuna nesneyi döndürmek için bir yöntem.
LwIP sistemlerinde, bu yöntem, önceden alınmış LwIP yığın kilidi ile çağrılmamalıdır.
GetBoundInterface
InterfaceId GetBoundInterface( void )
Bu uç noktada bağlı arabirimi alın.
Ayrıntılar | |
---|---|
İadeler | InterfaceId Bağlı arabirim kimliği. |
GetBoundPort
uint16_t GetBoundPort( void )
Dinle
INET_ERROR Listen( void )
UDP mesajlarını almak için uç noktayı hazırlayın.
Eğer State
zaten kState_Listening
, o zaman hiçbir işlemi yapılırken, aksi mState
olarak ayarlanır kState_Listening
ve uç nokta platformunun semantik göre, alınan UDP mesajlara hazırlanır.
Ayrıntılar | |||||
---|---|---|---|---|---|
Dönüş Değerleri |
|
LwIP'de, bu yöntem, önceden alınmış LwIP yığın kilidi ile çağrılmamalıdır.
Mesaj Gönder
INET_ERROR SendMsg( const IPPacketInfo *pktInfo, Weave::System::PacketBuffer *msg, uint16_t sendFlags )
Belirtilen bir hedefe bir UDP mesajı gönderin.
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önüş Değerleri |
|
Gönderildi
INET_ERROR SendTo( IPAddress addr, uint16_t port, Weave::System::PacketBuffer *msg, uint16_t sendFlags )
Eşanlamlıdır SendTo(addr, port, INET_NULL_INTERFACEID, msg, sendFlags)
.
Gönderildi
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önüş Değerleri |
|