If a unix socket is bound to a path, listen()
s and do some work, after which it is closed, the socket "file" remains in the filesystem. But if I try to connect()
to that path, I get
Connect errno:111
Connection refused
So what is left after the "artifact"? It is still an inode
on filesystem (I can see it with ls
), but it is not bound, not listening, and I cannot cat
it, otherwise I get
cat: /tmp/unix.str: No such device or address
So what remains from the inode
? And how can I make that "artifact" once more alive, bound and listening socket (without removing it, and creating fresh new socket with that path)?
What is the purpose of "dead" local socket (why is it not remove after it was closed, when there is no usage with it anymore)?
how can I revive the "dead" socket? (the main question)
who is responsible for error
connection refused
? not beingbind()
ed or notlisten()
ing?