On Wed, Jun 26, 2019 at 09:47:33AM +0200, David Jander wrote: [...] > > > Imagine a J1939 "server" that has 20 "clients" connected to it. It will thus > > > have 21 open sockets (one for the server itself (the bind()ed socket) and one > > > for each of the "clients" (the bind()ed and connect()ed sockets). Now imagine > > > the trouble of having to deal with the fact that every single message from > > > client A is received on all 21 sockets duplicated! You don't want that. Not > > > for big messages, nor for small ones. > > > > Every single message from client A is _not_ received on all 21 sockets. > > It's only recieved on the initial "server" bind()ed socket and the only > > one "client" bind()ed and connect()ed socket. > > > > On the other hand the "server" socket will receive all messages that the > > all the 20 "client" socket will receive. And we're trying to avoid that. > > You are absolutely right. Sorry. So it is not really as _bad_ as I pictured it > here, but I hope the explanation was clear and otherwise correct. ACK > Another thing is that if the server just close()es the client connection > socket, and the client sends more data, it will automatically get received on > the bind()ed server socket, and that is okay. That way a new connection can be > established if needed, and no data gets lost. In fact, it is the exact same > situation as the initial creation of the "connection" in the beginning. One more question regarding isolation of different sockets. Should we allow a bind()+connect() to the same tuple (SRC/DST/PGN) from more than one socket? We have to take care of Names, too...somehow. Oleksij & Marc -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |