blabaere / scaproust

Implementation of the nanomsg "Scalability Protocols" in rust.
Apache License 2.0
192 stars 9 forks source link

Unlink socket before bind #10

Closed kpcyrd closed 6 years ago

kpcyrd commented 6 years ago

I ran into the "Address already in use" issue and it probably makes more sense to solve this in the lib itself instead of me parsing the url, check if it's ipc and then remove the file.

According to stackoverflow and the linked bsd syslog source this is the correct way to solve this: https://stackoverflow.com/a/34881585

I've added an additional check though to make sure the file is indeed a socket.

blabaere commented 6 years ago

Thank you !

kpcyrd commented 6 years ago

@blabaere you might have clicked the wrong button, the PR is closed instead of merged. :)

blabaere commented 6 years ago

Indeed, done now.