Algorithm
Algorithm
Client
1. Create a socket
2. Connect the socket to the server
3. Read the string to be reversed from the standard input and send it to the server
Read the matrices from the standard input and send it to the server using the
socket
4. Read the reversed string from the socket and display it on the standard output
Read the product matrix from the socket and display it on the standard output
5. Close the socket
Server
1. Create a listening socket
2. bind IP address and port number to the socket
3. listen for incoming requests on the listening socket
4. accept the incoming request
5. connection socket is created when accepting returns
6. Read the string using the connection socket from the client
7. Reverse the string
8. Send the string to the client using the connection socket
9. close the connection socket
10. close the listening socket
Algorithm- UDP
Client
1. Create a socket
2. Read the matrices from the standard input and send it to the server using the
socket
3. Read the product matrix from the socket and display it on the standard output
4. Close the socket
Server
1. Create a socket
2. bind IP address and port number to the socket
3. Read the matrices socket from the client using the socket
4. Find the product of matrices
5. Send the product matrix to the client using socket
6. close the socket
Initialization :
N' = {u}
Server side
Step 1: Start the program
Step 2: create a socket with the help of socket() function
Step 3: bind the socket to the address and port number using the bind() function
Step 4: listen for the incoming requests using the listen() function
Step 5: receive request from the client using the recvfrom() function
Step 6: send the current time to the client using the sendto() function
Step 7: close the socket
Client side
Step 1: Start the program
Step 2: Send a request to the server asking for the current time
Step 3: Receive the current time from the server using the recvfrom() function
Step 4: Display the current time on the screen
Step 5: close the socket
Algorithm - FTP
Server side
Step 1: Start the program
Step 2: create a socket with the help of socket() function
Step 3: bind the socket to the address and port number using the bind() function
Step 4: listen for the incoming requests using the listen() function and accept the
incoming request
Step 5: receive ffile name from the client using the recvfrom() function
Step 6: if the file exists then read the file and send it to the client using the
sendto() function
Step 7: else send the error message to the client
Step 8: close the socket
Client side
Step 1: Start the program
Step 2: create a socket with the help of socket() function
Step 3: Send the file name to the server using the sendto() function
Step 4: Receive the file from the server using the recvfrom() function
Step 5: Display the file on the screen
Step 6: close the socket