Build Status Maintenance

embedded-nal-minimal-coaptcpserver

A minimal [CoAP-over-TCP] server implementation built on [embedded_nal].

This is the TCP equivalent of [embedded-nal-minimal-coapserver]; it serves to illustrate differences, and as a benchmarking tool to pitch CoAP-over-TCP against CoAP-over-UDP. It may, on the long run, also be useful where CoAP-over-TCP is practical for constrained devices (which is in NAT traversal); for that, it will need to gain some basic client capabilities to send requests.

Usage and operation

See also the equivalent section: Have a [ServerPool] and [ServerPool::poll] it whenever there might have been network activity.

Some (small) state is needed per TCP connection, which is stored along with the socket in a [ConnectionState]. All the [ServerPool] does is accept, poll the connections individually and drop the state (includeing a socket that is, by then, closed) when receiving an error. When other means of managing the connections are desired, including opening connections actively, that can just be done by replacing the ServerPool and calling [ConnectionState::poll_connection] manually.

Manual per-connection polling is currently also the way to go if you don't want to afford the stack allocation of the receive and send buffer, replacing it with some scratch memory are: [ConnectionState::pollconnectionwith_buffer] can be used with a locked scratch area then.

Caveats

See the equivalent section of embedded-nal-minimal-coapserver, with the following alterations:

Roadmap

The server is work in progress, but minimally functional.

The goal of this server is to stay a simple and minimal component, with somewhat less ambitions on production readiness than embedded-nal-minimal-coapserver.

License: MIT OR Apache-2.0