3
  • I have an application, where I send approx. 125 data items via a named pipe.
  • Each data item consists of data block 1 with max. 300 characters and data block 2 with max. 600 characters.
  • This gives 125 data items * (300 + 600) characters * 2 bytes per character = 125 * 900 * 2 = 225000 bytes.
  • Each data item is surrounded by curly braces like {Message1}{Message2}.
  • I noticed that if I send the messages, there are sending/receiving problems. Instead of {Message1}{Message2} the receiving application gets {Messa{Message2}.
  • Then I changed the sending code so that the messages are sent in 500 ms intervals. Then, the problem disappeared.

If I do everything correct (no bugs on my side, no misconfiguration of named pipes), how much time is required to send 225000 bytes over a named pipe from application in Delphi 2009 to application in .NET on the same machine?

What is a reasonable time for sending data of that size?

14
  • 3
    It sounds like your code is flawed. You should concentrate on finding and fixing the flaw. Adding sleep calls merely papers over the cracks. Find and fix the real problem. Commented Nov 8, 2012 at 8:06
  • Try a good IPC library here, Cromis-IPC.
    – LU RD
    Commented Nov 8, 2012 at 8:35
  • 4
    Are threads involved? The named pipe will send and receive exactly what you put down it, in the order you put it there. There is a logic problem in your code, so please revisit that "no bugs on my side" as it isn't true.
    – mj2008
    Commented Nov 8, 2012 at 9:51
  • 2
    Okay, so one thread either side. Are they running at the same time? It sounds like you simply are reaching buffer limits in the pipe. If the reader is not as fast as the writer, and the buffer is too small, and there is no synchronisation, then this will happen. Waiting for an acknowledgement by return (perhaps with a window to allow the reader to be up to 10 packets behind) would seem to be in order here.
    – mj2008
    Commented Nov 8, 2012 at 14:04
  • 1
    Post your code, and we'll find the bug. :-) Commented Nov 11, 2012 at 23:40

0