Allow listen_port to return selected port number #1

Merged
xavi merged 4 commits from midokura-xavi/libweb:listen-port into master 2023-11-20 16:24:34 +01:00
Contributor

This PR replaces the signature for handler_listen so, if 0 is selected as the port number, it can also be retrieved. Otherwise, there was no way for the caller to retrieve the port number selected by the operating system.

Also, a new function, namely handler_loop, has been added so as to split libweb's main loop from handler_listen.

This PR replaces the signature for `handler_listen` so, if `0` is selected as the port number, it can also be retrieved. Otherwise, there was no way for the caller to retrieve the port number selected by the operating system. Also, a new function, namely `handler_loop`, has been added so as to split `libweb`'s main loop from `handler_listen`.
midokura-xavi added 4 commits 2023-11-20 16:13:31 +01:00
8280cc40b9
README.md: Use generic term for copyright holders
Similarly to other projects within the free software community, a
generic term is used so as to avoid listing every single contributor to
the project.
98f5f52461
Split handler_loop from handler_listen
Some applications might set up a struct handler object to listen on any
port i.e., 0, but still need a way to determine which port number was
eventually selected by the implementation.

Therefore, handler_listen has been reduced to the server initialization
bit, whereas the main loop has been split into its own function, namely
handler_loop.

Because of these changes, it no longer made sense for libweb to write
the selected port to standard output, as this is something now
applications can do on their own.
xavi merged commit 44676b84fd into master 2023-11-20 16:24:34 +01:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: xavi/libweb#1
No description provided.