09-03-2022 01:45 PM
by any chance, could you share your code with us? I would like to do the same thing, but I am not an expert on using DLL and .h files.
Thanks,
09-03-2022 05:51 PM - edited 09-03-2022 05:55 PM
It's basically the code as used in this article to change the Nagle algorithm: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019NZfSAM
You will need to change a few minor things however:
1) Under Windows a SOCKET is defined to be the same as an UINT_PTR. This means that you should change the Call Library Node in the Windows variant to a pointer signed (unsigned) integer. Pharlap has only historical reason nowadays since NI doesn't sell Pharlap devices anymore. But as Pharlap was only 32-bit anyways it doesn't matter. On Unix platforms the parameter is an int and therefore always 32-bit.
2) Since you use an UDP connection you need to replace the TCP Get Raw Net Object.vi with the according UDP Get Raw Net Object.vi from the same location.
3) You need to change the protocol value from IPPROTO_TCP (6) to IPPROTO_IP (0) since the DONT_FRAGMENT option applies to the IP protocol level which is below the UDP or TCP protocol, but it only applies to message based protocols and in the case of the Microsoft Winsock providers only UDP and ICMP.
4) You need to change the TCP_NODELAY value (1) to the according value for your option IP_DONTFRAGMENT (9). Also the Call Library Node uses a U8 as actual value and specifies the size of the value as 1 byte. According to MSDN this should be a U32 even if it is only a boolean and the size would need to be changed accordingly to 4.
09-03-2022 10:04 PM
It worked like a charm. Thank friend.