11-30-2011 02:14 PM
I've encountered a mysterious problem:
I'm running a C program which communicates with copies of itself for distributed calculations. I'm now trying to incorporate a labview DLL to make function calls to VIs. However, merely declaring a DLL function call in my code mucks up the socket initialization.
The DLL is a compiled project containing a number of instruments.
For instance, I may have a line similar to:
//vi_function_call(parameter);
The line is commented out, I start my program. Sockets work fine and the process contains five threads.
I then uncomment the line:
vi_function_call(parameter);
but that's the only change. The function is never called. I start my program, and sockets no longer work correctly. Plus, my process now contains 15 threads!
From this sparse info, does anyone have a clue what may be going on?
12-01-2011 05:23 AM
OK, what happens is that a socket handle which usually gets a value of 404, instead gets a value of 9928, and the program can currently only handle values up to 2000.
I still don't understand this value jump, but at least I can work around that problem.
12-01-2011 08:48 AM
Upon further examination, I've found that:
Including labview somehow disables the upper bound for sockets. There's an upper bound set:
#define FD_SETSIZE 2000
which means accept() should return a socket with a value lower than 2000. Getting a value of 9288 should not happen, yet it does.