char sendbuf[BUFFER_SIZE]; fgets(sendbuf, sizeof(sendbuf), stdin); send(sock_cli, sendbuf, strlen(sendbuf),0); //Send out memset(sendbuf, 0, sizeof(sendbuf));