i made client/server program in that the client send strings to server ,then the server send it back to the server the length of the string that entered by the client ,so i added feature as this
when the client press "--" the server close the socketfd for that client then the client terminate its program as this
Client_side> please enter a sequence of characters followed by the new-line character:
hello students (input from a user)
Client_side > sending "hello students" to the server
Client_side > length= 14
Client_side > please enter a sequence of characters followed by the new-line character:
And the same happens again until the user quits by typing --.
Server_side > waiting for client messages.
Sever_side > reveiced "hello students" from the client (IP address, port #)
Server_side > Sending "14” to the client
Server_side > waiting for client messages
Server_side > received quit from client ...Goodbye (assuming the client typed --)
but i want to add to server code confirm question that when the user type "--" show the question : "Are you sure to exit Y/N ?"
if he type "y" then the server close the connfd for that client then the client will exit