Hi i am pretty new to socket programming and I've written a simple client/server system to send data over a socket. I've gotten it working so that I can send a string to the server and receive a reply.
Now I am trying to get the server to recognize command being sent from the client, but everything I send from the client has a newline character on the end. I know I can handle this from the server side, but is there a way to remove the newline character from the client side?
Here is the code which does the writing:
printf("Please enter the message: ");
bzero(buffer,256);
fgets(buffer,255,stdin);
n = write(sockfd,buffer,strlen(buffer));