buffer problem piping to an OS/2 rexx program 
Author Message
 buffer problem piping to an OS/2 rexx program

Hi, I'm posting yet another question. 8-)

Anyhow, this question is about a little program that I've been working on to
make the talk daemon for IBM tcpip pop up little dialog boxes when talk
requests come in instead of just spewing text into it's window which I usually
have minimized. (I posted about the feasibility of this before and a nice
fellow showed how it could be done).

The code I wrote (heavily borrowing from that nice fellow's) is:

/* VTALKD.CMD */
/* Run as talkd | pmrexx vtalkd */

call RxFuncAdd 'RxMessageBox' , 'RexxUtil', 'RxMessageBox'
do forever
   stmt = linein()
   parse var stmt tok1 tok2 . . tok5
   select
      when (tok1="Message") then time = tok5
      when ((tok1 = "talk:")&(tok2="respond")) then
        if RxMessageBox("From" tok5 "at" time, "Vtalkd - Incoming Talk Request" , "YesNo" , "Query")=6 then 'start talk' tok5
      otherwise NOP
      end
   end
end
EXIT

It works fine, except that it gets input from the pipe in bursts. It usually
takes two or three talk requests before vtalkd actually gets anything from the
pipe and then it gets it in a big burst of two/three requests at once. I did
a test with charin() and charout() just to see what was coming across the pipe,
and it was indeed in large bursts and it sometimes even cut lines across the
bursts...

Any explainations and/or help would be greatly appreciated.

                                                        -Benjamin Y. Lee

--
      ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
      | Team OS/2 - Running half an operating system... The better half. |
      | "Discontent is the first step         \/   "The heart is wiser   |
      | in the progress of a man or nation."  /\   than the intellect."  |



Fri, 05 Jul 1996 07:49:37 GMT  
 buffer problem piping to an OS/2 rexx program

Quote:
>Hi, I'm posting yet another question. 8-)

>Anyhow, this question is about a little program that I've been working on to
>make the talk daemon for IBM tcpip pop up little dialog boxes when talk
>requests come in instead of just spewing text into it's window which I usually
>have minimized. (I posted about the feasibility of this before and a nice
>fellow showed how it could be done).
>It works fine, except that it gets input from the pipe in bursts. It usually
>takes two or three talk requests before vtalkd actually gets anything from the
>pipe and then it gets it in a big burst of two/three requests at once. I did
>a test with charin() and charout() just to see what was coming across the pipe,
>and it was indeed in large bursts and it sometimes even cut lines across the
>bursts...

Sounds like the stdout from talkd is being buffered. It's probably detecting
that it's being piped, and to increase efficiency, it's buffering output to
stdout.

You can fix this if you have the source to talkd. If not, you can't (this is
the C code buffering, not the OS).

Cliff Nadler
L{*filter*}Federal Systems(?)
Note: This post represents the views of the poster not IBM or IBM FSC or
      L{*filter*}Corporation.



Sat, 06 Jul 1996 00:09:58 GMT  
 buffer problem piping to an OS/2 rexx program

Quote:

>Hi, I'm posting yet another question. 8-)

>/* Run as talkd | pmrexx vtalkd */

>It works fine, except that it gets input from the pipe in bursts. It usually
>takes two or three talk requests before vtalkd actually gets anything from the
>pipe and then it gets it in a big burst of two/three requests at once. I did
>a test with charin() and charout() just to see what was coming across the pipe,
>and it was indeed in large bursts and it sometimes even cut lines across the
>bursts...

>Any explainations and/or help would be greatly appreciated.

It may be that the output of talkd is buffered.  If so, then it only
sends output when the buffer is full.  I believe some of the OS/2
compilers or OS/2 itself may do some opptimizations when the stream
being written to is a device (the console) as opposed to a file or
pipe.  That would explain it, if true.

Can't think of anything you can do about it, off the top of my head
(except for re-writing talkd).

-------------------------------------------------------------------------
Patrick Mueller  | IBM Software Solutions, Cary NC; 919-469-7242, tie 883



Fri, 05 Jul 1996 08:41:01 GMT  
 buffer problem piping to an OS/2 rexx program

Quote:
> Can't think of anything you can do about it, off the top of my head
> (except for re-writing talkd).

I had a buffering problem with ftp.exe of TCP/IP 1.2.1.  Fortunately,
I could fix that by changing one line in the source code and
recompiling.  Unfortunately, the source code is no longer available
with TCP/IP 2.0.

Perhaps talkd.exe of TCP/IP 1.2.1 can be recompiled and used with TCP/IP 2.0.

--



Sat, 06 Jul 1996 20:22:16 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Turning off pipe buffering, or flushing pipe?

2. Upgrade of OS/2 causes problems with previous rexx programs

3. piping input and output with OS/2 REXX

4. Named Pipes - Rexx (Os/2

5. NAMED PIPES - REXX (OS/2)

6. Piping ELM mail into REXX script (os/2)

7. Migrating OS/2 REXX programs to REXX Windows??????

8. Program output piping in OS/2

9. Pipes (was: Invocation of Rexx programs)

10. REXXPERTS: Multitasking/Piping with REXX into a program that uses stdin

11. Rexx and Pipes Problem

12. Problems with Named Pipes in Rexx/2

 

 
Powered by phpBB® Forum Software