LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Socket problem using labview DLL

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?

 

Lars Melander
Uppsala Database Laboratory, Uppsala University
0 Kudos
Message 1 of 3
(2,558 Views)

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.

Lars Melander
Uppsala Database Laboratory, Uppsala University
0 Kudos
Message 2 of 3
(2,550 Views)

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.

 

Lars Melander
Uppsala Database Laboratory, Uppsala University
0 Kudos
Message 3 of 3
(2,543 Views)