Subj : WinSock To : Jon Justvig From : Digital Man Date : Wed Jun 13 2018 08:50 pm Re: WinSock By: Jon Justvig to Digital Man on Wed Jun 13 2018 07:34 pm > Re: WinSock > By: Digital Man to Jon Justvig on Wed Jun 13 2018 12:24 pm > > SOCKET current_client = (SOCKET)lpParam; > > // buffer to hold our recived data > char buffer; > // buffer to hold our sent data > char sendData[20]; > // for error checking > int result; > > // our recv loop > while (true) > { > > result = recv(current_client, (char*)&buffer, 1, 0); // recv cmds > > Sleep(10); That Sleep() call shouldn't be necessary - just for debugging use? > if (result > 0) > { > cout << "\n\tMessage from client: " << buffer; > send(current_client, (char*)&buffer, 1, 0); > } > } > } > > Right now, it works, however, on the client side it only shows one character > at at time with Message from client: (character the remote end sent) ...I > tried using a char array, however, it was just showing back garbage. How > might I get input up to about 12 characters until the "\r" (carriage return) > is received to the server from the remote client? See sockreadline() in http://cvs.synchro.net/cgi-bin/viewcvs.cgi/src/sbbs3/mailsrvr.c?revision=1.621 It's recv()'s one byte at a time a builds up the string until a \n is received. You could easily adapt that to terminate on \r instead. I purposely pointed you to an old revision that doesn't support TLS, because the implementation is more simple. digital man This Is Spinal Tap quote #7: Nigel Tufnel: That's just nitpicking, isn't it? Norco, CA WX: 74.6øF, 51.0% humidity, 0 mph S wind, 0.00 inches rain/24hrs --- þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net .