‎08-21-2011 04:22 AM
hello all!
when i'm trying to open the same udp socket from two different applications, i get error 60 :
"Address in use".
i know for sure that it is possible.
but how i do that with labview ?
thanks.
guy.
Solved! Go to Solution.
‎08-21-2011 07:56 AM
Well, I think you have answered your own question. You will need to setup a framework where you initialize just once and then pass that reference to both applications that use the read and write VIs to access the UDP port.
‎08-21-2011 10:06 AM
ok , i will explain more clearly.
i have one application that's not created in labview, and i have no control on it , but i know for sure i can use the same port this app is using for listening
because it has been done with some other app (also not created in labview).
so, this app runs first and listen to a port.
now i want that my app (which i created in labview) will use the same port - also for listening.
how can i tell labview to open the same port without having to encounter error 60 ?
‎08-21-2011 12:41 PM
I agree with Adnan that this is not really possible with the normal mechanisms. The OS needs to know which application should get the data. An exception are e.g. packet sniffers (such as Wireshark) that intercept the network traffic at a lower level and passively listen in.
Please provide some details on what "other applications" have done this.
‎08-21-2011 01:02 PM
those applications are costume made by software engineers at my workplace, written in C#.
you cannot find them at the internet.
i understand that what i'm asking to do (passive listening to a port) can't be done with the current labview version, is that right ?
‎08-21-2011 01:12 PM
Yes, it can be done, but you need to dig a little deeper (e.g. using activeX or a third party dll).
You might want to get started by reading this thread.
‎08-21-2011 01:14 PM
@hookso wrote:
those applications are costume made by software engineers at my workplace, written in C#.
you cannot find them at the internet.
I beg to differ. There are numerous examples of how to write a sniffer in C#. Here's one example: http://www.codeproject.com/KB/IP/CSNetworkSniffer.aspx. The software engineers at your company would have done something very similar. So, you could use .NET to create a sniffer or you could try the WinPCAP alternative that altenbach mentioned.
‎12-05-2011 01:55 AM
‎09-14-2017 04:23 AM
Could u share the the labview code, c# and required dll.
‎06-01-2018 06:28 AM
Hey Hookso,
It's been a while since this thread was used, but I have a similar use-case. Do you think you could share the C# code snippet where you configure the socket? I'm sure I could find something on stackoverflow, so I'll probably go there if no response, but I figured maybe we could just blow the dust off of this thread.