unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* RE: Fibers web server: use multiple server sockets
@ 2022-11-02 18:15 dsmich
  2022-11-02 18:27 ` Vivien Kraus
  2022-11-02 19:19 ` tomas
  0 siblings, 2 replies; 7+ messages in thread
From: dsmich @ 2022-11-02 18:15 UTC (permalink / raw)
  To: 'Vivien Kraus'; +Cc: 'guile-user'

> From: "Vivien Kraus" 
> To: "guile-user"
> Sent: Wednesday November 2 2022 12:38:05PM
> Subject: Fibers web server: use multiple server sockets

> Fibers is a library that I would very much like to use. It provides
a
> nice web server. However, as I recently discovered, in a standard
> GNU/Linux server, not all network interfaces and addresses are up
when
> the server is about to start (especially so with dhcp). I have a
nice
> solution for that: every now and then, the server calls getaddrinfo.

How about not starting the web server until network interfaces are
fully up?

-Dale




^ permalink raw reply	[flat|nested] 7+ messages in thread
* Fibers web server: use multiple server sockets
@ 2022-11-02 16:37 Vivien Kraus
  0 siblings, 0 replies; 7+ messages in thread
From: Vivien Kraus @ 2022-11-02 16:37 UTC (permalink / raw)
  To: guile-user

Dear guile fiber users,

Fibers is a library that I would very much like to use. It provides a
nice web server. However, as I recently discovered, in a standard
GNU/Linux server, not all network interfaces and addresses are up when
the server is about to start (especially so with dhcp). I have a nice
solution for that: every now and then, the server calls getaddrinfo. If
a previously bound address does not appear anymore in the return value,
then close the socket it was bound to. If a new address is returned by
the function, create a new socket for it and bind it to the new address
(and listen). This means that if a new address appears for the host
argument, then the server will eventually listen to it without having
to restart anything. If an address is dropped, eventually the server
will stop listening to it.

I would like to have that in the fibers web server. However, I
understand that not everyone would want it, or some would do it
differently (e.g. by using guile-netlink or something else). I think
the web server should make “listen”, “fcntl” (for set-nonblocking!) and
“accept” generic (with parameters, or GOOPS, or…?) so that I could fit
my weird thing within the call to accept.
Ultimately, everything could be expressed in terms of “accept” and have
the default implementation call listen and set-nonblocking! lazily
during the first call to accept. 

What do you think? Should the fibers web server try to do the
getaddrinfo thing by itself or be extensible and let me do it myself?
Are you OK with GOOPS? Do you prefer parameters? Do you have other
options?

Best regards,

Vivien



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-11-02 23:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-02 18:15 Fibers web server: use multiple server sockets dsmich
2022-11-02 18:27 ` Vivien Kraus
2022-11-02 19:19 ` tomas
2022-11-02 19:35   ` Dr. Arne Babenhauserheide
2022-11-02 19:57     ` tomas
2022-11-02 23:04       ` Ricardo Wurmus
  -- strict thread matches above, loose matches on Subject: below --
2022-11-02 16:37 Vivien Kraus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).