libcoap 4.3.2rc2

Functions
TCP Support
Libcoap Internal API

Internal API for handling CoAP TCP (RFC8323) More...

## Functions
int | coap_socket_connect_tcp1 (coap_socket_t *sock, const coap_address_t *local_if, const coap_address_t *server, int default_port, coap_address_t *local_addr, coap_address_t *remote_addr)
| Create a new TCP socket and initiate the connection. More...
int | coap_socket_connect_tcp2 (coap_socket_t *sock, coap_address_t *local_addr, coap_address_t *remote_addr)
| Complete the TCP Connection. More...
int | coap_socket_bind_tcp (coap_socket_t *sock, const coap_address_t *listen_addr, coap_address_t *bound_addr)
| Create a new TCP socket and then listen for new incoming TCP sessions. More...
int | coap_socket_accept_tcp (coap_socket_t *server, coap_socket_t *new_client, coap_address_t *local_addr, coap_address_t *remote_addr)
| Accept a new incoming TCP session. More...

## Detailed Description

Internal API for handling CoAP TCP (RFC8323)

## Function Documentation

## ◆ coap_socket_accept_tcp()

int coap_socket_accept_tcp | ( | coap_socket_t * | server,
|  | coap_socket_t * | new_client,
|  | coap_address_t * | local_addr,
|  | coap_address_t * | remote_addr
| ) |  |

Accept a new incoming TCP session.

Internal function.

Parameters

  server | The socket information to use to accept the TCP connection
  new_client | Filled in socket information with the new incoming session information
  local_addr | Filled in with the local address
  remote_addr | Filled in with the remote address

Returns
  `1` if succesful, `0` if failure of some sort

Definition at line 299 of file coap_tcp.c.

## ◆ coap_socket_bind_tcp()

int coap_socket_bind_tcp | ( | coap_socket_t * | sock,
|  | const coap_address_t * | listen_addr,
|  | coap_address_t * | bound_addr
| ) |  |

Create a new TCP socket and then listen for new incoming TCP sessions.

Internal function.

Parameters

  sock | Where socket information is to be filled in
  listen_addr | The address to be listening for new incoming sessions
  bound_addr | Filled in with the address that the TCP layer is listening on for new incoming TCP sessions

Returns
  `1` if succesful, `0` if failure of some sort

Definition at line 204 of file coap_tcp.c.

## ◆ coap_socket_connect_tcp1()

int coap_socket_connect_tcp1 | ( | coap_socket_t * | sock,
|  | const coap_address_t * | local_if,
|  | const coap_address_t * | server,
|  | int | default_port,
|  | coap_address_t * | local_addr,
|  | coap_address_t * | remote_addr
| ) |  |

Create a new TCP socket and initiate the connection.

Internal function.

Parameters

  sock | Where socket information is to be filled in
  local_if | The local address to use or NULL
  server | The address to connect to
  default_port | The port to use if not set in `server`
  local_addr | Filled in after connection initiation with the local address
  remote_addr | Filled in after connection initiation with the remote address

Returns
  `1` if succesful, `0` if failure of some sort

Definition at line 43 of file coap_tcp.c.

## ◆ coap_socket_connect_tcp2()

int coap_socket_connect_tcp2 | ( | coap_socket_t * | sock,
|  | coap_address_t * | local_addr,
|  | coap_address_t * | remote_addr
| ) |  |

Complete the TCP Connection.

Internal function.

Parameters

  sock | The socket information to use
  local_addr | Filled in with the final local address
  remote_addr | Filled in with the final remote address

Returns
  `1` if succesful, `0` if failure of some sort

Definition at line 165 of file coap_tcp.c.