class TCPEndPoint

Defined at line 89 of file gen/third_party/openweave-core/src/include/InetLayer/TCPEndPoint.h

Objects of this class represent TCP transport endpoints.

Public Members

bool ReceiveEnabled
 State
OnConnectCompleteFunct OnConnectComplete
OnDataReceivedFunct OnDataReceived
OnDataSentFunct OnDataSent
OnConnectionClosedFunct OnConnectionClosed
OnPeerCloseFunct OnPeerClose
OnConnectionReceivedFunct OnConnectionReceived
OnAcceptErrorFunct OnAcceptError

Public Methods

INET_ERROR Bind (IPAddressType addrType, IPAddress addr, uint16_t port, bool reuseAddr)

Bind the endpoint to an interface IP address.

On LwIP, this method must not be called with the LwIP stack lock

already acquired.

Parameters

addrType [in] the protocol version of the IP address
addr [in] the IP address (must be an interface address)
port [in] the TCP port
reuseAddr [in] option to share binding with other endpoints
INET_ERROR Listen (uint16_t backlog)

Prepare the endpoint to receive TCP messages.

On some platforms, the

argument is not used (the depth of

the queue is fixed; only one connection may be accepted at a time).

On LwIP systems, this method must not be called with the LwIP stack

lock already acquired

Parameters

backlog [in] maximum depth of connection acceptance queue
INET_ERROR Connect (IPAddress addr, uint16_t port, InterfaceId intf)

Initiate a TCP connection.

Parameters

addr [in] the destination IP address
port [in] the destination TCP port
intf [in] an optional network interface indicator
INET_ERROR GetPeerInfo (IPAddress * retAddr, uint16_t * retPort)

Extract IP address and TCP port of remote endpoint.

Parameters

retAddr [out] IP address of remote endpoint.
retPort [out] TCP port of remote endpoint.
INET_ERROR GetLocalInfo (IPAddress * retAddr, uint16_t * retPort)

Extract IP address and TCP port of local endpoint.

Parameters

retAddr [out] IP address of local endpoint.
retPort [out] TCP port of local endpoint.
INET_ERROR Send (Weave::System::PacketBuffer * data, bool push)

Send message text on TCP connection.

Parameters

data [out] Message text to send.
push [out] If then send immediately, otherwise queue.
void DisableReceive ()

Disable reception.

void EnableReceive ()

Enable reception.

INET_ERROR EnableNoDelay ()

EnableNoDelay

INET_ERROR EnableKeepAlive (uint16_t interval, uint16_t timeoutCount)

Enable the TCP "keep-alive" option.

See RFC 1122, section 4.2.3.6 for specification details.

Parameters

interval [in] time in seconds between probe requests.
timeoutCount [in] number of probes to send before timeout.
INET_ERROR DisableKeepAlive ()

Disable the TCP "keep-alive" option.

INET_ERROR SetUserTimeout (uint32_t userTimeoutMillis)

Set the TCP TCP_USER_TIMEOUT socket option.

Parameters

userTimeoutMillis [in] Tcp user timeout value in milliseconds.
INET_ERROR AckReceive (uint16_t len)

Acknowledge receipt of message text.

Parameters

len [in] number of bytes to acknowledge.
INET_ERROR PutBackReceivedData (Weave::System::PacketBuffer * data)

Push message text back to the head of the receive queue.

Parameters

data [out] Message text to push.
uint32_t PendingSendLength ()

Extract the length of the data awaiting first transmit.

Returns

Number of untransmitted bytes in the transmit queue.

uint32_t PendingReceiveLength ()

Extract the length of the unacknowledged receive data.

Returns

Number of bytes in the receive queue that have not yet been

acknowledged with

AckReceive(uint16_t len)

.

INET_ERROR Shutdown ()

Initiate TCP half close, in other words, finished with sending.

INET_ERROR Close ()

Initiate TCP full close, in other words, finished with both send and

receive.

void Abort ()

Abortively close the endpoint, in other words, send RST packets.

void Free ()

Initiate (or continue) TCP full close, ignoring errors.

bool IsConnected ()

Extract whether TCP connection is established.

Defined at line 715 of file gen/third_party/openweave-core/src/include/InetLayer/TCPEndPoint.h

void SetConnectTimeout (const uint32_t connTimeoutMsecs)
void SetIdleTimeout (uint32_t timeoutMS)

Set timer event for idle activity.

void MarkActive ()

Note activity, in other words, reset the idle timer.

Defined at line 725 of file gen/third_party/openweave-core/src/include/InetLayer/TCPEndPoint.h

uint16_t LogId ()

Obtain an identifier for the endpoint.

Returns

Returns an opaque unique identifier for use logs.

Defined at line 720 of file gen/third_party/openweave-core/src/include/InetLayer/TCPEndPoint.h

Enumerations

enum 
Name Value
kState_Ready kBasisState_Closed
kState_Bound 1
kState_Listening 2
kState_Connecting 3
kState_Connected 4
kState_SendShutdown 5
kState_ReceiveShutdown 6
kState_Closing 7
kState_Closed 8

Basic dynamic state of the underlying endpoint.

Defined at line 110 of file gen/third_party/openweave-core/src/include/InetLayer/TCPEndPoint.h

Friends

class InetLayer