Saturday, July 11, 2015

IP Lab Ex 3 : Socket Programming - UDP


Now, we gotta learn some basics in socket programming in Java. You could use internet and check out about it. I have a basic code over here, that I found in many sites :

Source Code

And in this code, they used BufferedReader Class Object and all, for obtaining the input from the user. You could actually use the one with the Scanner Class Object.

Rest of the code is kinda self explanatory, based on networking. And there is a while loop in the server code, just to show that the server is infinitely running and provides the service to many clients.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.