المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Named Pipe reading very slowly



C# Programming
10-29-2009, 01:30 PM
Hi,

I have a inbound named pipe in overlapped mode. The client connects and writes in the pipe created by the server.

The client is writing real-time data very fast in the named pipe, but the server is not reading the data fast enough.

This is creating a delay between what is happening in the real-time application and the data that is given by the read in the server.

If I decrease the rate at which the client writes to the named pipe, I get better results (the real-time application and the data read in the server tend to match) but by decreasing the rate I am not getting smooth data, meaning I am getting samples of data from the real-time application periodically.

On the other hand if I decrease the buffersize in the Named pipe, and the rate of writing to the named pipe is fast, the real-time application drags itself and gets very slow. I am guessing this is because the named pipe gets filled very fast and since it is Overlapped the data cannot be overwritten unless the slow reader finishes reading it.

So my problem is:

Case 1 - (fast write rate, large buffer): server read data and the real-time app are way off
Case 2 - (fast write rate, small buffer): application hangs
Case 3 - (slow write rate, *): server read data is not smooth (not acceptable)

Did anyone face similar problems? All suggestions are much appreciated.