IRC logs of Libera.Chat #BZFlag for Thursday, 2021-09-02

*** _I_Died_Once <_I_Died_Once!~I_Died_On@c-73-184-170-223.hsd1.ga.comcast.net> has joined #bzflag02:16
*** I_Died_Once <I_Died_Once!~I_Died_On@c-73-184-170-223.hsd1.ga.comcast.net> has quit IRC (Ping timeout: 245 seconds)02:19
*** Zehra <Zehra!~Yukari@user/yukari> has quit IRC (Quit: Quit.)02:40
*** I_Died_Once <I_Died_Once!~I_Died_On@c-73-184-170-223.hsd1.ga.comcast.net> has joined #bzflag02:59
*** _I_Died_Once <_I_Died_Once!~I_Died_On@c-73-184-170-223.hsd1.ga.comcast.net> has quit IRC (Ping timeout: 245 seconds)03:02
*** Harlin <Harlin!~DonQixote@c-24-128-8-53.hsd1.co.comcast.net> has quit IRC (Remote host closed the connection)03:14
*** Harlin <Harlin!~DonQixote@c-24-128-8-53.hsd1.co.comcast.net> has joined #bzflag03:14
*** I_Died_Once <I_Died_Once!~I_Died_On@c-73-184-170-223.hsd1.ga.comcast.net> has quit IRC (Ping timeout: 244 seconds)03:19
*** Sgeo <Sgeo!~Sgeo@user/sgeo> has quit IRC (Read error: Connection reset by peer)06:18
*** Harlin <Harlin!~DonQixote@c-24-128-8-53.hsd1.co.comcast.net> has quit IRC (Read error: Connection reset by peer)07:40
*** Harlin <Harlin!~DonQixote@c-24-128-8-53.hsd1.co.comcast.net> has joined #bzflag07:40
*** I_Died_Once <I_Died_Once!~I_Died_On@c-73-184-170-223.hsd1.ga.comcast.net> has joined #bzflag11:03
*** Sgeo <Sgeo!~Sgeo@user/sgeo> has joined #bzflag14:02
blast007I'm going to play around with an mDNS/DNS-SD library to see if that would be a viable replacement for our current LAN discovery.15:38
*** Gort[m] <Gort[m]!~M-gort-ma@2001:470:69fc:105::7ed> has joined #bzflag15:38
blast007Our current "ping packet" for discovery includes the IP of the server (via the ServerId structure) and the IP of the requesting client, which I'd need to change to handle multiple addresses of different types.15:44
blast007I also think our current discovery doesn't work for servers on a non-default port, though I don't know if mDNS would be any better there.15:47
blast007I'm not sure if mDNS lets you run multiple instances of a server on a host, since it appears like it listens on a port for queries.  The library I'm looking at does set the socket options SO_REUSEADDR and, if available, SO_REUSEPORT when creating the discovery socket, so I'm assuming it does.16:01
tuponeSO_REUSEPORT or SO_REUSEADDR, IIRC, works only if IP address on what it binds on is different. But I don't know why you need that19:19
blast007SO_REUSEPORT "Permits  multiple  AF_INET  or  AF_INET6 sockets to be bound to an identical socket address."19:27
blast007(from 'man 7 socket')19:28
blast007for Winsock, the SO_REUSEADDR says "Allows a socket to bind to an address and port already in use."19:36
blast007though I also see "Once the second socket has successfully bound, the behavior for all sockets bound to that port is indeterminate. For example, if all of the sockets on the same port provide TCP service, any incoming TCP connection requests over the port cannot be guaranteed to be handled by the correct socket — the behavior is non-deterministic."19:37
blast007I don't know if that's also a problem for UDP19:37
blast007"Two separate sockets cannot bind to the same local interface (and port, in the case of TCP/IP) to await incoming connections. If two sockets are actively listening on the same port, the behavior is undefined as to which socket will receive notification of an incoming connection. The SO_REUSEADDR option is most useful in TCP when a server shuts down or exits abnormally so that the local ...19:41
blast007... address and port are in the TIME_WAIT state, which prevents any other sockets from binding to that port. By setting this option, the server can listen on the same local interface and port when it is restarted."  guess I'll just have to try it and see19:41
blast007sounds like SO_REUSEADDR is designed for use when restarting a service so that the previously bound port isn't blocked from use for a time if the service crashes19:44
tuponewithout reading a lot I imagined that every listener receive a packet, but that did not work. Maybe it works on multicast19:46
blast007yeah, I have little knowledge about mDNS19:47
blast007maybe the applications are supposed to advertise themselves through another daemon on the system (Bonjour on Mac, Avahi on Linux, and I suppose also Bonjour on Windows, unless MS has their own version now)19:48
tuponeohh m stand for multicast. then it should work19:48
blast007k19:59
blast007I'll toy around with it19:59

Generated by irclog2html.py 2.17.3.dev0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!