# otTcpEndpoint


`#include <openthread/tcp.h>`

Represents a TCP endpoint.

## Summary

A TCP endpoint acts an endpoint of TCP connection. It can be used to initiate TCP connections, and, once a TCP connection is established, send data to and receive data from the connection peer.

The application should not inspect the fields of this structure directly; it should only interact with it via the TCP API functions whose signatures are provided in this file.

| ### Public attributes ||
|---|---|
| `https://openthread.io/reference/struct/ot-tcp-endpoint#structot_tcp_endpoint_1a80ce7f01c4b584e177ed4e61b11f2b6e` | `uint64_t` |
| `https://openthread.io/reference/struct/ot-tcp-endpoint#structot_tcp_endpoint_1a63c36af8c93cac4933adbd9e21526e39` | `void *` A pointer to application-specific context. |
| `https://openthread.io/reference/struct/ot-tcp-endpoint#structot_tcp_endpoint_1a9fd09ac1e8e6548849f339779d5f540d` | `https://openthread.io/reference/group/api-tcp#group__api-tcp_1ga03a1e75e384d545c95cf5acb51f8728b` "Disconnected" callback function |
| `https://openthread.io/reference/struct/ot-tcp-endpoint#structot_tcp_endpoint_1a1d84634f280acc571a067b9f79a9011f` | `https://openthread.io/reference/group/api-tcp#group__api-tcp_1ga25c56312aca352fb3f023fab53687558` "Established" callback function |
| `https://openthread.io/reference/struct/ot-tcp-endpoint#structot_tcp_endpoint_1ac256d76098417e56c86efb341bb36198` | `https://openthread.io/reference/group/api-tcp#group__api-tcp_1ga69935ba978a5984e8b38b5fc8854c6fb` "Forward progress" callback function |
| `https://openthread.io/reference/struct/ot-tcp-endpoint#structot_tcp_endpoint_1aadd3487fa170b2efbe425ac1e939d400` | `struct https://openthread.io/reference/struct/ot-tcp-endpoint *` A pointer to the next TCP endpoint (internal use only) |
| `https://openthread.io/reference/struct/ot-tcp-endpoint#structot_tcp_endpoint_1a1979453198d18743094a5fc12a9c9c9b` | `uint8_t` |
| `https://openthread.io/reference/struct/ot-tcp-endpoint#structot_tcp_endpoint_1a2c3b3852f93fb3d3b20b4c68abb71b92` | `https://openthread.io/reference/group/api-tcp#group__api-tcp_1gaaad9c380c56bfe2dfee43b8f45bfe499` "Receive available" callback function |
| `https://openthread.io/reference/struct/ot-tcp-endpoint#structot_tcp_endpoint_1af8c32095603d4db9bc98c2bcc20574e0[2]` | `https://openthread.io/reference/struct/ot-linked-buffer` |
| `https://openthread.io/reference/struct/ot-tcp-endpoint#structot_tcp_endpoint_1a5f6f0769e72e8ff72f88f304fdc2f5b8` | `https://openthread.io/reference/group/api-tcp#group__api-tcp_1gab49b3db0f5d27c85e72672468b6c425b` "Send done" callback function |
| `https://openthread.io/reference/struct/ot-tcp-endpoint#structot_tcp_endpoint_1add20d686fe65ef4ef8a4c1a62757f0cd[392+36 *sizeof(void *)]` | `uint8_t` |
| `https://openthread.io/reference/struct/ot-tcp-endpoint#structot_tcp_endpoint_1a7cc7f550b14d11ce5d04de3b3b228275` | `https://openthread.io/reference/struct/ot-sock-addr` |
| `https://openthread.io/reference/struct/ot-tcp-endpoint#structot_tcp_endpoint_1a54cd92e66d4bad08b7299e3f8f821c93` | `union otTcpEndpoint::@21` |
| `https://openthread.io/reference/struct/ot-tcp-endpoint#structot_tcp_endpoint_1ac2b9e7c3f1756407bfc99e0db0c2c9b3[4]` | `uint32_t` |

## Public attributes

### mAlign

```
uint64_t otTcpEndpoint::mAlign
```

### mContext

```
void * otTcpEndpoint::mContext
```
A pointer to application-specific context.

### mDisconnectedCallback

```
otTcpDisconnected otTcpEndpoint::mDisconnectedCallback
```
"Disconnected" callback function

### mEstablishedCallback

```
otTcpEstablished otTcpEndpoint::mEstablishedCallback
```
"Established" callback function

### mForwardProgressCallback

```
otTcpForwardProgress otTcpEndpoint::mForwardProgressCallback
```
"Forward progress" callback function

### mNext

```
struct otTcpEndpoint * otTcpEndpoint::mNext
```
A pointer to the next TCP endpoint (internal use only)

### mPendingCallbacks

```
uint8_t otTcpEndpoint::mPendingCallbacks
```

### mReceiveAvailableCallback

```
otTcpReceiveAvailable otTcpEndpoint::mReceiveAvailableCallback
```
"Receive available" callback function

### mReceiveLinks

```
otLinkedBuffer otTcpEndpoint::mReceiveLinks[2]
```

### mSendDoneCallback

```
otTcpSendDone otTcpEndpoint::mSendDoneCallback
```
"Send done" callback function

### mSize

```
uint8_t otTcpEndpoint::mSize[392+36 *sizeof(void *)]
```

### mSockAddr

```
otSockAddr otTcpEndpoint::mSockAddr
```

### mTcb

```
union otTcpEndpoint::@21 otTcpEndpoint::mTcb
```

### mTimers

```
uint32_t otTcpEndpoint::mTimers[4]
```

## Resources

OpenThread API Reference topics originate from the source code, available
on [GitHub](https://github.com/openthread/openthread/tree/main/include/openthread).
For more information, or to contribute to our documentation, refer to
[Resources](https://openthread.io/resources).