11-04-2014, 02:25 PM
CLIENT-SERVER CHAT USING UDP
AIM
To write a C program for implementing chat program using UDP.
ALGORITHM
SERVER
Step 1: Start the program.
Step 2: Create an unnamed socket for the server using the
parameters AF_INET as domain and the SOCK_DGRAM as type.
Step 3: Name the socket using bind( ) system call with the
parameters server_sockfd and the server
address(sin_addr and sin_sport).
Step 4: The server gets the message from the client.
Step 5: Prints the message.
Step 6: Stop the program execution.
CLIENT
Step 1: Start the program.
Step 2: Create an unnamed socket for client using socket
Step 3: Call with parameters AF_INET as domain an
SOCK_DGRAM as type.
Step 4: Name the socket using bind( ) system call.
Step 5: The Sendto( ) system call is used to deliver the
Message to the server.
Step 6: Stop the program execution.
RESULT
Thus the C program for chat using UDP is executed and the output is verified successfully.