Single Threaded Echo Server using UDP for client and server - Computer Programming

Latest

C C++ Java Python Perl Programs Examples with Output -useful for Schools & College Students

Sunday, October 30, 2011

Single Threaded Echo Server using UDP for client and server


Single Threaded Echo Server using UDP
(Client Algorithm)

1. Create a UDPclient class
2. Declare DatagramSocket and DatagramPacket
3. Enter some string.
4. Convert the string in byte format
5. Create a DatagramPacket
6. Send the packet using DatagramSocket
7. Create another DatagramPacket which will receive the bytes from the server
8. Receive the bytes using DatagramSocket
9. Display it in the output
10. End
Single Threaded Echo Server using UDP
(Server Algorithm)

1. Create a UDPserver class
2. Declare DatagramSocket and DatagramPacket
3. Create the DatagramSocket
4. Receive the bytes using DatagramSocket
5. Display it in the output
6. Send the packet using DatagramSocket
7. End

No comments:

Post a Comment