mirror of https://github.com/joan2937/pigpio
This commit is contained in:
parent
4b2a1efdab
commit
5c1f52215d
4
pigpio.c
4
pigpio.c
|
@ -8292,7 +8292,7 @@ int initInitialise(void)
|
||||||
}
|
}
|
||||||
server6.sin6_port = htons(port);
|
server6.sin6_port = htons(port);
|
||||||
|
|
||||||
int opt;
|
int opt = 1;
|
||||||
setsockopt(fdSock, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
|
setsockopt(fdSock, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
|
||||||
if (bind(fdSock,(struct sockaddr *)&server6, sizeof(server6)) < 0)
|
if (bind(fdSock,(struct sockaddr *)&server6, sizeof(server6)) < 0)
|
||||||
SOFT_ERROR(PI_INIT_FAILED, "bind to port %d failed (%m)", port);
|
SOFT_ERROR(PI_INIT_FAILED, "bind to port %d failed (%m)", port);
|
||||||
|
@ -8307,7 +8307,7 @@ int initInitialise(void)
|
||||||
SOFT_ERROR(PI_INIT_FAILED, "socket failed (%m)");
|
SOFT_ERROR(PI_INIT_FAILED, "socket failed (%m)");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int opt;
|
int opt = 1;
|
||||||
setsockopt(fdSock, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
|
setsockopt(fdSock, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
|
||||||
}
|
}
|
||||||
server.sin_family = AF_INET;
|
server.sin_family = AF_INET;
|
||||||
|
|
Loading…
Reference in New Issue