I want to create a Console Application in VB that broadcasts to all IPs on Local Area Network his own Ip.
So a Timer that broadcasts the IP of the server every second. Every client that connects, receives the IP of the Server.
Then, a client logs in to the Application and sends 2 strings to the Servers IP:
- Username
- Password
The server checks the validity of the 2 strings, and either allows or restricts access to the Server.
How should I proceed?
I have found TcpClient and TcpListener, but I am unable to broadcast an IP to 255.255.255.255…
Mainly, what I want to achieve, is broadcast (255.255.255.255) my Local Ip (192.168.1.1), so I would broadcast the String “192.168.1.1”
You should take a look at the UDP classes instead of the TCP classes. UDP will allow you to broadcast small messages on your LAN. One the IP address is received, then you can use TCP to connect to the server.