mirror of
https://github.com/ohwgiles/laminar.git
synced 2024-10-27 20:34:20 +00:00
unlink unix sockets before binding
This commit is contained in:
parent
713462f37f
commit
b7644494fc
@ -380,12 +380,16 @@ Server::Server(LaminarInterface& li, kj::StringPtr rpcBindAddress,
|
|||||||
tasks(*this)
|
tasks(*this)
|
||||||
{
|
{
|
||||||
// RPC task
|
// RPC task
|
||||||
|
if(rpcBindAddress.startsWith("unix:"))
|
||||||
|
unlink(rpcBindAddress.slice(strlen("unix:")).cStr());
|
||||||
tasks.add(ioContext.provider->getNetwork().parseAddress(rpcBindAddress)
|
tasks.add(ioContext.provider->getNetwork().parseAddress(rpcBindAddress)
|
||||||
.then([this](kj::Own<kj::NetworkAddress>&& addr) {
|
.then([this](kj::Own<kj::NetworkAddress>&& addr) {
|
||||||
acceptRpcClient(addr->listen());
|
acceptRpcClient(addr->listen());
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// HTTP task
|
// HTTP task
|
||||||
|
if(httpBindAddress.startsWith("unix:"))
|
||||||
|
unlink(httpBindAddress.slice(strlen("unix:")).cStr());
|
||||||
tasks.add(ioContext.provider->getNetwork().parseAddress(httpBindAddress)
|
tasks.add(ioContext.provider->getNetwork().parseAddress(httpBindAddress)
|
||||||
.then([this](kj::Own<kj::NetworkAddress>&& addr) {
|
.then([this](kj::Own<kj::NetworkAddress>&& addr) {
|
||||||
acceptHttpClient(addr->listen());
|
acceptHttpClient(addr->listen());
|
||||||
|
Loading…
Reference in New Issue
Block a user