John Peterson

> Im trying to get tcpserver to work with my simple
> program written in C. However, Im getting unexpected
> results...
> ...
> printf("Welcome! Enter your name\n");
> scanf("%s",name);
> printf("Hello %s",name);
> ...
> ------------------------------------------
> bash-2.04$ telnet 127.0.0.1 555
> Trying 127.0.0.1...
> Connected to 127.0.0.1.
> Escape character is '^]'.
> Bob
> Welcome! Enter your name:
> Hello Bob                
> ------------------------------------------
> It does the input first, and then all the output in
> one shot!

Try flushing the output after the welcome message.  Worked for me.

---Kris


Reply via email to