You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Windows support issue it was suggested to use Unix domain sockets where available. I tried to tackle this issue, here are some observations.
With plain sockets we don't need to select a port, one is chosen randomly every time. Ideally something similar should happen when using Unix sockets. There is an autobinding feature that can achieve this, but it seems to be supported only on Linux, and my rudimentary attempts of getting it to work in the code failed (but that's probably fixable).
Generally (and portably), Unix sockets use file names for communication. As an alternative to random ports, I tried creating a temporary file, this has the following complications:
A socket cannot be bound to an existing file, so the temporary file must be deleted before it's used for communication. This might introduce, probably rare, race conditions.
The file remains in the filesystem after the sockets are closed. This shouldn't be a real problem, since the file is either created in the system's temp directory or in the current session's directory.
I've implemented the above, and it seems to be working. But I would prefer to use some more reliable way of generating file names.
Any suggestions?
The text was updated successfully, but these errors were encountered:
Thinking about it, it is possible to generate a random directory for each socket, and then create the communication file there (again, noting that some of those will remain in the user's temporary directory). That should avoid the race condition mentioned above.
If that sounds reasonable, I can implement it and send a pull request.
In the Windows support issue it was suggested to use Unix domain sockets where available. I tried to tackle this issue, here are some observations.
With plain sockets we don't need to select a port, one is chosen randomly every time. Ideally something similar should happen when using Unix sockets. There is an autobinding feature that can achieve this, but it seems to be supported only on Linux, and my rudimentary attempts of getting it to work in the code failed (but that's probably fixable).
Generally (and portably), Unix sockets use file names for communication. As an alternative to random ports, I tried creating a temporary file, this has the following complications:
I've implemented the above, and it seems to be working. But I would prefer to use some more reliable way of generating file names.
Any suggestions?
The text was updated successfully, but these errors were encountered: