LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

build application with .net dll's

Hello
 
I have labview 8.2.1 program that use .net framework 2.0 dll's, under labview there no problem.
but after convert to *.exe application the communism failed (System.Net.Sockets.SocketException
    Only one usage of each socket address (protocol/network address/port) is normally permitted
    System)
1) do you know why?
2)do you know how to solve the problem?
3) what does the differents of run  under labview or runtime?
0 Kudos
Message 1 of 2
(2,755 Views)

Hi Herman,

You might be able to cure this by explicitly closing the connection before your EXE terminates, anyway, there's a nice description of this error here - it seems to be an OS "feature".  The way I read this, if your EXE terminates leaving a connection open, the port will remain "reserved" for several minutes - the OS is trying to protect the port for you, not realizing you don't need it any more.  No other application - including your re-launched EXE - can use the port before the timeout.  Smiley Surprised  The link describes a registry-mod allowing you to set  this OS timeout to a smaller value. Smiley Wink

In the development environment, when you open the port, the OS allocates it to LabVIEW.exe - making it easier to reause the port while developing.  Also, there's a little vi called "Internacine Avoider.vi" used to remember what ports are already opened - so LabVIEW knows to reuse them instead of trying to open them again.

Cheers!  

Message Edited by tbd on 08-22-2007 11:00 PM

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 2 of 2
(2,718 Views)