Open jacobbridges opened 9 years ago
If you are working on a network that allows broadcasting, you could have receivers specify their named port and listen for that name to be broadcast on the network. Once the name was broadcast along with a connection address by the sender, the receivers could be given a certain timeout period in which they were allowed to connect to the sender, and the sender would start sending its data to all connected receivers once the timeout period expired.
I apologize for the delayed response, somehow I missed this comment.
Your named pipe implementation is much cleaner than mine--in my idea when a "sending" pipe was created it would also spawn a simple async-server in a separate process which would keep a registry of the pipe names and addresses. It would handle simple communica like "I want to register pipe name "logs" to host=localhost and port=8000" and "Get the address info for sending pipe with name "logs"".
I still think a solution with a separate server would be useful--it would allow receiving pipes to be created after the sender pipe started streaming, not a requirement to be setup first. It would allow for receiving pipes to disconnect and reconnect. But, my troubles with the asyncore
library have dissuaded me from the separate server implementation and I'm ready to use your idea.
So far cutiepipe only has one main pipe. An important, needed feature is "named pipes". Maybe with the following syntax: