-2

I have developed an application to send message via TCP client and Listener. I am using a ComboBox and ping system to test which PC is online in the network.

How can I restrict the list to only those PCs on which my messenger application is running?

Anthon
  • 69,918
  • 32
  • 186
  • 246
dearzubi
  • 113
  • 1
  • 11

1 Answers1

0

I am assuming it is running on a local network...

You should build in message "types" into your app. You can then send out a broadcast "is anyone there?" message. You do this using the broadcast IP subnet address x.x.x.255.

All PCs running your app should interpret the "is anyone there?" message and respond with a "I am here" message type. Collect them and populate your combo box.

joehanna
  • 1,471
  • 1
  • 11
  • 22
  • broadcast IP address is not working. it is giving "invalid IP....." and i can send msg using UDP but how to respond back. If i uses TCP to send and get response it will give error for those IPs on which applications is not running so it will take a lot of time. Any idea? – dearzubi Jun 22 '15 at 08:58
  • Sorry @zubair130, I meant "subnet" address: 255.255.255.255. Of course, this also depends on your network configuration. What is your own workstation IP address so I can give you specific assistance? I have edited my answer. I have done this on a project. I will look up the code for you. – joehanna Jun 22 '15 at 09:05
  • my local ip address is 192.168.1.5 (at this time) , subnet mask is 255.255.255.0, default gateway is 192.168.1.1 – dearzubi Jun 22 '15 at 09:37
  • if you can please provide me basic piece of code as i am completely new in it. – dearzubi Jun 22 '15 at 09:40
  • I have solve the issue almost. I have used UNOLIBS.NET class (http://www.codeproject.com/Articles/9382/TCP-IP-With-VB-Net-version-more-power-more-ease). If the receiver is not responding it gives back the message that "IP is not reachable." But problem is that it takes long time. How can I lower that time any help please????? – dearzubi Jun 22 '15 at 10:42