Kbase P59749: Third-party process reading from named pipe receives incompl
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  17/12/2003 |
|
Status: Unverified
FACT(s) (Environment):
UNIX
SYMPTOM(s):
Third-party process reading from named pipe receives incomplete data
Progress application is writing to the named pipe
A multiple of 512 bytes is received by the reader, the remainder of the data is lost.
CAUSE:
This can occur depending on how the third-party product reads from the named pipe.
Some products rely purely on the number of buffers flushed to the named pipe, or use this in combination with a timeout to determine if the data received is complete.
In these case if the last buffer isn't flushed in time or if the data sent spans too many full buffers, the reader can stop reading without receiving all the data, which in turn can cause the reader to malfunction.
FIX:
On the side of the writer, the size of the buffer can be adjusted to better accommodate the reader process.
There is currently no way do to this directly from the Progress 4GL, but the standard UNIX tool dd can be used to handle this conversion.
Instead of passing the data directly to the named pipe using OUTPUT TO, use OUTPUT THROUGH to the UNIX dd tool and specify the desired buffer size:
OUTPUT STREAM stream name THROUGH "dd obs=buffer size >>pipe name 2>/dev
ull".
/*
obs=buffer size -> output block size (=buffer size) dd will use.
Set to desired buffer size.
>>pipe name -> redirect file output to named pipe in append mode.
2>/dev
ull -> redirect screen output to /dev
ull. Suppresses dd
diagnostic output.
*/