# otTcpListener


`#include <openthread/tcp.h>`

Represents a TCP listener.

## Summary

A TCP listener is used to listen for and accept incoming TCP connections.

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-listener#structot_tcp_listener_1ac3396285cee29e3da6a8acdd9a206689` | `https://openthread.io/reference/group/api-tcp#group__api-tcp_1ga399f95bb0ad56cbe6f317127fdf2e7be` "Accept done" callback function |
| `https://openthread.io/reference/struct/ot-tcp-listener#structot_tcp_listener_1acb349428f16d8c0b51777ccd745b7011` | `https://openthread.io/reference/group/api-tcp#group__api-tcp_1gaf53a2e6d1a995ed5f7e09f6799bc828c` "Accept ready" callback function |
| `https://openthread.io/reference/struct/ot-tcp-listener#structot_tcp_listener_1ac3a2b68c66553522b8fe92c049ca7736` | `void *` |
| `https://openthread.io/reference/struct/ot-tcp-listener#structot_tcp_listener_1a60e6837ade072a45c19b7fbf9083da84` | `void *` A pointer to application-specific context. |
| `https://openthread.io/reference/struct/ot-tcp-listener#structot_tcp_listener_1a28d7812f53289c5d39b2ad4a56836701` | `struct https://openthread.io/reference/struct/ot-tcp-listener *` A pointer to the next TCP listener (internal use only) |
| `https://openthread.io/reference/struct/ot-tcp-listener#structot_tcp_listener_1a2c686912126af49ff0208e90de8df589[16+3 *sizeof(void *)]` | `uint8_t` |
| `https://openthread.io/reference/struct/ot-tcp-listener#structot_tcp_listener_1aa8260b69ddc4bca96b238b16070c3795` | `union otTcpListener::@22` |

## Public attributes

### mAcceptDoneCallback

```
otTcpAcceptDone otTcpListener::mAcceptDoneCallback
```
"Accept done" callback function

### mAcceptReadyCallback

```
otTcpAcceptReady otTcpListener::mAcceptReadyCallback
```
"Accept ready" callback function

### mAlign

```
void * otTcpListener::mAlign
```

### mContext

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

### mNext

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

### mSize

```
uint8_t otTcpListener::mSize[16+3 *sizeof(void *)]
```

### mTcbListen

```
union otTcpListener::@22 otTcpListener::mTcbListen
```

## 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).