I doing this server and client program. The sever has to output to the client.
strcpy ( outBuf, " " );
sprintf ( outBuf, "cylinder: %d Sector: %d\n", cylinders, sectors );
if ( write ( client_sockfd, outBuf, strlen ( outBuf ) + 1 ) < 0 ) {
perror ( "Client: Fails to write to socket." );
exit ( 3 );
}
I cout outBuf to server:
outBuf: cylinder: 5 Sector: 5
at the client end:
> I -- this is input
cylinder: 5 Sector: --this is all that gets printed.
> enter I again and hit enter
5
>
as you can see when i hit return, then the rest of the stream gets printed. can someone help me fix this]?
thanks
drjay
the when i hit enter again, the 5 gets printed.