How about a mix of hashing and text file? That means a given endpoint will always use the same port by default, and then we can increment to find a free port. This removes most/all the problems of cleaning up, I think.
On Thu, Oct 2, 2014 at 5:32 PM, Doron Somech <[email protected]> wrote: > I would go with mutex and shared file, but I think it is complicated to > implement, because every time socket connects it has to check the file and > cannot actually use hashing. The problems with hashing: > > * Try to bind and port is taken ? > * Try to connect but the peer is not zeromq > * Try to connect and the peer is zeromq but not the one I actually want. > > Because of the third problem we will have to check the file on every connect > which mean we don't need the hashing, just the file. > > So we have a file, every time we bind we bind to ephemeral port and write a > row to the file with the port and the name and every time we connect we > check the file, but the remain case is when do we clear the file? > > > > > > On Thu, Oct 2, 2014 at 3:12 PM, Pieter Hintjens <[email protected]> wrote: >> >> This is annoying mainly because it hurts code portability and also >> because ipc:// (especially with abstract endpoints) is a nicer >> semantic for local services than TCP ports. e.g. I've a protocol >> called zccp and the default location for a zccp broker is >> ipc://@/zccp. >> >> Solution: cheat, on Windows >> >> Real solution: accept "ipc://" endpoints and hash them to a socket >> number in the ephemeral range, then bind/connect on 127.0.0.1 with >> that port number. >> >> Difficulty: hash conflicts. :-) >> >> If anyone has a plausible solution to hash conflicts (registry?) then >> this should be quite simple to make. >> >> -Pieter >> _______________________________________________ >> zeromq-dev mailing list >> [email protected] >> http://lists.zeromq.org/mailman/listinfo/zeromq-dev > > > > _______________________________________________ > zeromq-dev mailing list > [email protected] > http://lists.zeromq.org/mailman/listinfo/zeromq-dev > _______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
