Kaydet (Commit) 690df746 authored tarafından Enrico Tröger's avatar Enrico Tröger

Windows: Use SO_EXCLUSIVEADDRUSE flag for IPC socket

SO_REUSEADDR on Windows allows to bind to an already used port
without an error. This way we never notice if the port is already used.
So use the Windows special flag SO_EXCLUSIVEADDRUSE to ensure we receive
an error if the port is already used.

Part of #641.
üst d951db1e
......@@ -524,7 +524,7 @@ static gint socket_fd_open_inet(gushort port)
}
val = 1;
if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) < 0)
if (setsockopt(sock, SOL_SOCKET, SO_EXCLUSIVEADDRUSE, &val, sizeof(val)) < 0)
{
log_error("Failed to set IPC socket exclusive option", -1);
socket_fd_close(sock);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment