Where have you used UDP Socket Programming?

Answer: The answer is up to you if you have used UDP socket programming in your project. If you have not used in your project or you are a fresher, then you can say that you have not used, but you can answer the concept where we can use upd socket programming in real time application. You can take the udp example of mine described below.

I have done UDP socket programming for one of the software projects in which we had to discover a specific type of devices sitting with others devices like laptops, computer and mobile etc. in a LAN (Local Area Network) in an organization.

We follow UDP client server program to discover the desired device (A machine with WinCE OS). On machine whom we wanted to discover, we wrote an udp server program running continuously and from a device from where we wanted to discover the machine, we wrote a udp client program. UDP server was responding to clients e.g. tablets with a specific hard coded message with unique custom ID and IP addresses.

UDP client program that can sit on any devices tabs, laptops and computers etc. broadcast special type of Broadcast IP Address e.g. 255.255.255.255 that searches all devices on LAN.

In our case we use tables where upd client program is running. It broadcast IP Address 255.255.255.255 in the local area network and all devices were responding with their IP address.

On client side we filter the specific response with message that udp server was responding. This is the way we find specific machine using upd discovery programming.

Below is the example in which number 2 and 4 are the specific type of machine with udp server program and rest are other devices. Also, there are udp clients on which client program is installed.

udpclientserver

When we run client program, it broadcast an IP address and all other devices responds with their ip addresses. Machine 2 and 4 will include special message with their IP that we are filtering to recognize the machine in local area network.

NOTES:

You can view your local IP and subnet by firing command “ipconfig” on cmd console on windows machine. For Unix machine use command “ifconfig” to gets its own ip address.

Related Posts