Mellroth Posted September 27, 2007 Report Share Posted September 27, 2007 Hi, I need to have a lot of UDP sockets in a server implemented on a LabVIEW RT machine, but currently there seems to be limit of 60 sockets. Even if the Maximum Number Of Sockets is set to 200 in MAX. To test number of sockets available, I use the code displayed below. When no more sockets can be opened the VI returns error 42 in UDP Open, (Generic Error). Anyone know how to get past this limit? I guess I'm missing something obvious. /J Quote Link to comment
Neville D Posted September 27, 2007 Report Share Posted September 27, 2007 Instead of opening a lot of sockets, can you use UDP Broadcast instead? Also, try adding a bit of delay between each Open to see if its time-related. Neville. Quote Link to comment
Jim Kring Posted September 28, 2007 Report Share Posted September 28, 2007 QUOTE(JFM @ Sep 26 2007, 09:42 AM) Hi,I need to have a lot of UDP sockets in a server implemented on a LabVIEW RT machine, but currently there seems to be limit of 60 sockets. Even if the Maximum Number Of Sockets is set to 200 in MAX. To test number of sockets available, I use the code displayed below. When no more sockets can be opened the VI returns error 42 in UDP Open, (Generic Error). Anyone know how to get past this limit? I guess I'm missing something obvious. /J In Windows XP SP2 there is a limit to the number of sockets that the OS will allow you to open, in order to prevent viruses from spreading (talk about a band-aid solution). There is a patch tool, here (use at your own risk), that will allow you to adjust this. Quote Link to comment
Mellroth Posted September 28, 2007 Author Report Share Posted September 28, 2007 Thanks for your comments, but my guess is that this is only solved by some hidden KEY in the NI-RT.ini file. QUOTE(Neville D @ Sep 27 2007, 12:02 AM) Instead of opening a lot of sockets, can you use UDP Broadcast instead?Also, try adding a bit of delay between each Open to see if its time-related. Currently Broadcast is not an option, it has been ruled out earlier. I have tried to add a delay, but that has no effect. What matters is how you set the Maximum Number of Sockets in MAX. If you break the limit given in MAX, you'll get error code 11, (To many files open), if you then increase the number in MAX, you will instead run into another limit, that throws error 42 when it is reached. QUOTE(Jim Kring @ Sep 27 2007, 01:59 AM) In Windows XP SP2 there is a limit to the number of sockets that the OS will allow you to open, in order to prevent viruses from spreading (talk about a band-aid solution). There is a patch tool, here (use at your own risk), that will allow you to adjust this. I need to open my sockets on a RT target, I guess this tool is only for Windows, or can it be used on Pharlap as well? For the record I have tried to open 1000 UDP sockets on Windows, without any problem. /J Quote Link to comment
Neville D Posted September 28, 2007 Report Share Posted September 28, 2007 QUOTE(JFM @ Sep 26 2007, 10:21 PM) Thanks for your comments, but my guess is that this is only solved by some hidden KEY in the NI-RT.ini file.Currently Broadcast is not an option, it has been ruled out earlier. I have tried to add a delay, but that has no effect. What matters is how you set the Maximum Number of Sockets in MAX. If you break the limit given in MAX, you'll get error code 11, (To many files open), if you then increase the number in MAX, you will instead run into another limit, that throws error 42 when it is reached. I need to open my sockets on a RT target, I guess this tool is only for Windows, or can it be used on Pharlap as well? For the record I have tried to open 1000 UDP sockets on Windows, without any problem. /J I think it is time to get NI involved. Open up a service request and get some of NI's RT experts to take a look. Your problem is easily duplicated, so its something they can follow up with pretty quickly. good luck. N. Quote Link to comment
Mellroth Posted September 29, 2007 Author Report Share Posted September 29, 2007 QUOTE(Neville D @ Sep 27 2007, 07:04 PM) I think it is time to get NI involved. Open up a service request and get some of NI's RT experts to take a look. Your problem is easily duplicated, so its something they can follow up with pretty quickly.good luck. N. Thanks, I have contacted NI, but the first suggestion was to increase the Maximum Number of Sockets, but that didn't solve my problem. We have a workaround, that will solve this specific problem, but I still don't think that the OS should limit the number of sockets (it's OK to limit the number by default, but it must be possible to get past this limit somehow). I'll update this thread if/when I get a clear response from NI. /J Quote Link to comment
Mellroth Posted October 9, 2007 Author Report Share Posted October 9, 2007 Hi, I just received information from NI, that this is a limitation of the Pharlap OS, on VxWorks targets (e.g. cRIO 9012) this limitation does not exist. NI will fix the error message in LV-RT 8.5.1, but has no more information to get past this limit. /J Quote Link to comment
Rolf Kalbermatter Posted October 9, 2007 Report Share Posted October 9, 2007 QUOTE(JFM @ Oct 8 2007, 07:54 AM) Hi,I just received information from NI, that this is a limitation of the Pharlap OS, on VxWorks targets (e.g. cRIO 9012) this limitation does not exist. NI will fix the error message in LV-RT 8.5.1, but has no more information to get past this limit. I'm not sure what version of Pharlap they purchased. But even if they got the source code for it, fiddling with the network socket code in an OS is a very tricky thing to do. Probably there would be a #define somewhere for the maximum allowable sockets and that is were it goes wrong. In many RT OSes the sockets are maintained in a static list and being static means it is preallocated at compile time and can never grow bigger than the max. Changing that into a dynamic list has possible performance drawbacks and makes the resource management in general more complex, so that is not something one wants to modify into an existing static implementation. Nice to hear that VxWorks seems not to have this limitation. Rolf Kalbermatter Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.