Hi,

Im trying to get tcpserver to work with my simple
program written in C. However, Im getting unexpected
results. My programm on execution is supposed to print
a welcome message to stdout, then read text from stdin
, then writes into stdout again. The source code looks
something like this.
...
printf("Welcome! Enter your name\n");
scanf("%s",name);
printf("Hello %s",name);
...

I use tcpserver to execute that program when there is
a connection to localhost on port 123 , like so
tcpserver 127.0.0.1 123 programname

however when i try telneting to 127.0.0.1 123
I dont get any "Welcome message" from my program.
upon telneting the programm is waiting for me to input
something... When I enter somthing , only then do I
get
the  "Welcome..." then "Hello ".
------------------------------------------
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!

Any ideas why that is happening or how to get it to
work???


Newbie.

_______________________________________________________
Do You Yahoo!?
Get your free @yahoo.ca address at http://mail.yahoo.ca

Reply via email to