This commit is contained in:
Adrian Liechti 2024-06-24 13:54:49 +08:00 committed by GitHub
commit afed7ee0db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2563,6 +2563,13 @@ int main(int argc, char ** argv) {
svr->set_read_timeout (params.timeout_read); svr->set_read_timeout (params.timeout_read);
svr->set_write_timeout(params.timeout_write); svr->set_write_timeout(params.timeout_write);
#ifndef _WIN32
if (params.hostname.substr(0, 7) == "unix://") {
svr->set_address_family(AF_UNIX);
params.hostname = params.hostname.substr(7);
}
#endif
if (!svr->bind_to_port(params.hostname, params.port)) { if (!svr->bind_to_port(params.hostname, params.port)) {
fprintf(stderr, "\ncouldn't bind to server socket: hostname=%s port=%d\n\n", params.hostname.c_str(), params.port); fprintf(stderr, "\ncouldn't bind to server socket: hostname=%s port=%d\n\n", params.hostname.c_str(), params.port);
return 1; return 1;