mirror of
https://github.com/rofafor/vdr-plugin-satip.git
synced 2023-10-10 13:37:42 +02:00
Set SO_REUSEPORT only if it's defined.
This commit is contained in:
parent
fd23b0483a
commit
b5483b9d77
2
socket.c
2
socket.c
@ -51,8 +51,10 @@ bool cSatipSocket::Open(const int portP, const bool reuseP)
|
|||||||
ERROR_IF_FUNC(setsockopt(socketDescM, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) < 0,
|
ERROR_IF_FUNC(setsockopt(socketDescM, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) < 0,
|
||||||
"setsockopt(SO_REUSEADDR)", Close(), return false);
|
"setsockopt(SO_REUSEADDR)", Close(), return false);
|
||||||
yes = reuseP;
|
yes = reuseP;
|
||||||
|
#ifdef SO_REUSEPORT
|
||||||
ERROR_IF_FUNC(setsockopt(socketDescM, SOL_SOCKET, SO_REUSEPORT, &yes, sizeof(yes)) < 0 && errno != ENOPROTOOPT,
|
ERROR_IF_FUNC(setsockopt(socketDescM, SOL_SOCKET, SO_REUSEPORT, &yes, sizeof(yes)) < 0 && errno != ENOPROTOOPT,
|
||||||
"setsockopt(SO_REUSEPORT)", Close(), return false);
|
"setsockopt(SO_REUSEPORT)", Close(), return false);
|
||||||
|
#endif
|
||||||
// Bind socket
|
// Bind socket
|
||||||
memset(&sockAddrM, 0, sizeof(sockAddrM));
|
memset(&sockAddrM, 0, sizeof(sockAddrM));
|
||||||
sockAddrM.sin_family = AF_INET;
|
sockAddrM.sin_family = AF_INET;
|
||||||
|
Loading…
Reference in New Issue
Block a user