nl :: Inet :: UDPEndPoint
#include <src/inet/UDPEndPoint.h>
이 클래스의 개체는 UDP 전송 끝점을 나타냅니다.
요약
Nest Inet Layer는 UDP 전송 엔드 포인트 (Linux 및 BSD 파생 시스템의 SOCK_DGRAM 소켓) 또는 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 바인딩 된 인터페이스 ID입니다. |
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.
세부 | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
매개 변수 |
| ||||||||||||
반환 값 |
|