prash Posted August 19, 2009 Report Share Posted August 19, 2009 Hi All, I want to develop a simple pc messenger application using TCP\IP protocol. I want to send a broadcast message to all the systems connected on LAN how can i do it and also how can i get all the IP address os all systems on LAN Quote Link to comment
PaulL Posted August 19, 2009 Report Share Posted August 19, 2009 Are all the applications using the messages LabVIEW applications? If so then I think the simplest and quickest way to implement this is to use networked shared variables. These allow you to use a publish-subscribe protocol. (You said you wanted to broadcast the message.) If you just have one message you write periodically you could use just the TCP/IP primitive VIs in a loop to write the same message to each recipient. (Or you could use UDP to broadcast.) There is also a Simple Messaging Reference Library (STM) available. Personally I think these can give you a good idea of how things should work, but I don't know why anyone would use them instead of shared variables (since these already do the work for you). Quote Link to comment
Christian_L Posted August 19, 2009 Report Share Posted August 19, 2009 Hi All, I want to develop a simple pc messenger application using TCP\IP protocol. I want to send a broadcast message to all the systems connected on LAN how can i do it and also how can i get all the IP address os all systems on LAN TCP does not support broadcasting as it requires a connection for each communication link, however UDP does allow for broadcasting to all systems on the local subnet. Each system listening just needs to open a UDP port at a known port number, and then you can broadcast a message using UDP to that given port number. (Send the UDP message to 255.255.255.255 for broadcasting.) You can send out a Discover or Ping message so that each system listening responds to the sender with its name and IP address. This wil provide a list of available systems to the sender. You can check out the Asynchronous Message Communication (AMC) reference library which handles most of what you are asking for. It includes a Ping function which will discover all of the systems on the network which have the AMC listener enabled. This allows you to get a list of devices on the network so that you can send directed messages to each. Quote Link to comment
Mark Yedinak Posted August 19, 2009 Report Share Posted August 19, 2009 TCP does not support broadcasting as it requires a connection for each communication link, however UDP does allow for broadcasting to all systems on the local subnet. Each system listening just needs to open a UDP port at a known port number, and then you can broadcast a message using UDP to that given port number. (Send the UDP message to 255.255.255.255 for broadcasting.) You can send out a Discover or Ping message so that each system listening responds to the sender with its name and IP address. This wil provide a list of available systems to the sender. You can check out the Asynchronous Message Communication (AMC) reference library which handles most of what you are asking for. It includes a Ping function which will discover all of the systems on the network which have the AMC listener enabled. This allows you to get a list of devices on the network so that you can send directed messages to each. If you use UDP and broadcasting you need to be aware that most switches will restrict UDP broadcasts to a single subnet. If you are in an environment where you may have multiple subnets the UDP broadcast scheme may not work in this environment. This has nothing to do with LabVIEW but rather how most networks and switches are configured. Quote Link to comment
Eugen Graf Posted August 19, 2009 Report Share Posted August 19, 2009 Just look on the Web-Chat project by mine: Quote Link to comment
Phillip Brooks Posted August 19, 2009 Report Share Posted August 19, 2009 Just look on the Web-Chat project by mine: I just downloaded it, tried it, and was going to suggest it! LabVOOP may be a bit much for someone new to LabVIEW though... Quote Link to comment
Eugen Graf Posted August 20, 2009 Report Share Posted August 20, 2009 I just downloaded it, tried it, and was going to suggest it! LabVOOP may be a bit much for someone new to LabVIEW though... OFFTOP There is no much LVOOP, only a clever cluster, no more. So it's understandable by any. TOTOP: So you may try to collect all connections into an array and send to all in a for-loop (if you use TCP) and send a broadcast to all if you use UDP (but without ack). 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.