c file (stream) input buffer problem help PLEASE! 
Author Message
 c file (stream) input buffer problem help PLEASE!

I have a c I/O program that fputs's to a tty1 port connected to a
remote device and then fgets's from it for the response.  It works
quite well.

Here is my problem.  This program is called from a cgi script (perl
open w/pipe) to process a request from the script.  If the client
escapes, the program gets cancelled fine but the data from the host is
still in the pipe.

I have put in signal traps to read through the response until it is
clear and then exit.  This sort of works but not always.

Is there a way upon starting the program and opening the tty file that
it can be READ until there is NO data, then resume the normal flow???

I tried fflush'ing (NG) and fgets'ing but it just hangs.

Any recommendations will be IMMEDIATELY APPRECIATED>

Thanks.



Sun, 10 Jun 2001 03:00:00 GMT  
 c file (stream) input buffer problem help PLEASE!


Quote:
>I have a c I/O program that fputs's to a tty1 port connected to a
>remote device and then fgets's from it for the response.  It works
>quite well.

>Here is my problem.  This program is called from a cgi script (perl
>open w/pipe) to process a request from the script.  If the client
>escapes, the program gets cancelled fine but the data from the host is
>still in the pipe.

Your problem is with Unix IPC and/or device handling, not with the C
language. Truy asking in comp.unix.programmer.

--
-----------------------------------------


-----------------------------------------



Mon, 11 Jun 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. file input stream buffer as string array!

2. newbie question about input stream buffer

3. no buffering stream input.

4. Memory stream or Buffered stream ?

5. Keyboard buffer problems...please help!

6. Problems with array elements from user input, please help

7. Serial port input problem -- Please help

8. ANN: Numeric input from file streams

9. Problem with input stream redirection in lex

10. Input stream problem

11. Help with the input buffer

12. HELP: clearing input buffer in c

 

 
Powered by phpBB® Forum Software