This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Socket manager

Hello,

Multiple threads on our board require network connections, which can be over either the LTE-M modem, or over ethernet.

To this end, we created a Socket Manager thread. This receives requests from the other threads and should open and close sockets, write to them, and forward any read data to the owning thread.

This leads to 2 challenges:
- What is the best way to monitor the active sockets in parallel, so that we can notify the owning threads when data / events arive?
- How do we also support the requests coming in at the same time?

Ideas:
- Socket Manager thread alternates between checking the request Message Queue and polling the sockets (this seems ugly)
- Socket Manager thread spawn threads for every new socket (then, how do we dynamically allocate and start threads?)

Feedback or better ideas are greatly appreciated!

Parents Reply Children
No Data
Related