Trying to solve issue with RA using IPTOS_LOWDELAY
This commit is contained in:
parent
78465cfac8
commit
412c3255c2
1 changed files with 6 additions and 2 deletions
|
@ -10,6 +10,7 @@
|
|||
|
||||
#include <netdb.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netinet/ip.h>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <syslog.h>
|
||||
|
@ -307,10 +308,10 @@ int main(int argc, const char* argv[])
|
|||
int trapHandle;
|
||||
int mediaHandle;
|
||||
int remoteHandle;
|
||||
int socketOptionValue;
|
||||
struct sockaddr_in proxySocketAddress;
|
||||
|
||||
socklen_t proxySocketLength = sizeof(proxySocketAddress);
|
||||
int socketOptionValue = true;
|
||||
|
||||
proxySocketAddress.sin_family = AF_INET;
|
||||
proxySocketAddress.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
|
@ -324,6 +325,7 @@ int main(int argc, const char* argv[])
|
|||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
socketOptionValue = true;
|
||||
proxySocketAddress.sin_port = 0;
|
||||
remoteHandle = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
||||
if((remoteHandle < 0) ||
|
||||
|
@ -334,11 +336,13 @@ int main(int argc, const char* argv[])
|
|||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
socketOptionValue = IPTOS_LOWDELAY;
|
||||
proxySocketAddress.sin_port = 0;
|
||||
mediaHandle = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
||||
if((mediaHandle < 0) ||
|
||||
(bind(mediaHandle, (struct sockaddr*)&proxySocketAddress, proxySocketLength) < 0) ||
|
||||
(getsockname(mediaHandle, (struct sockaddr*)&proxySocketAddress, &proxySocketLength) < 0))
|
||||
(getsockname(mediaHandle, (struct sockaddr*)&proxySocketAddress, &proxySocketLength) < 0) ||
|
||||
(setsockopt(mediaHandle, IPPROTO_IP, IP_TOS, &socketOptionValue, sizeof(socketOptionValue)) < 0))
|
||||
{
|
||||
print("Error opening port for External Server\n");
|
||||
return EXIT_FAILURE;
|
||||
|
|
Loading…
Add table
Reference in a new issue