commit | b2ce96addbb28ef7d4f6f63b77029a24bab6156a | [log] [tgz] |
---|---|---|
author | Eli Lipsitz <elipsitz@google.com> | Wed Mar 08 22:45:27 2023 +0000 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Wed Mar 08 22:45:27 2023 +0000 |
tree | 7f1af9a3ea7fcf9fe74267cd29729f9154f2b8b7 | |
parent | 28f28fb1e65a8746a1c6eece2025b841ee8ce648 [diff] |
pw_stream: Create ServerSocket class This commit adds a new ServerSocket class that aims to improve on the shortcomings of SocketStream (when used as a server). The class: 1) Supports multiple clients 2) Splits the Listen and Accept operations (the old Serve method was a source of race conditions) 3) Allows for random port assignment A user will now create a single ServerSocket, call `Listen` once, and `Accept` as many times as needed, each call creates a new SocketStream for communicating with that client. Due to the improvements in ServerSocket, it and SocketStream can now be tested reliably, so tests have been added. Bug: b/271321951 Change-Id: Ic5cd42eb0e36169ed18891cc06d0704867cb0254 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/131611 Commit-Queue: Eli Lipsitz <elipsitz@google.com> Reviewed-by: Wyatt Hepler <hepler@google.com>
Pigweed is an open source collection of embedded-targeted libraries–or as we like to call them, modules. These modules are building blocks and infrastructure that enable faster and more reliable development on small-footprint MMU-less 32-bit microcontrollers like the STMicroelectronics STM32L452 or the Nordic nRF52832.
For more information please see our website: https://pigweed.dev/.