简体   繁体   中英

Pipe communication

I am creating one application in which there are three components:

  • EXE1
  • WCF service
  • EXE2

EXE1 writes data to pipe then WCF read the data and send it to EXE2. But scenario is, EXE1 writes data to pipe in for loop.So i just want to know,suppose EXE1 had write data into pipe but wcf is doing some other work and not read that data yet.Now EXE1 trying to write second data.So in this condition whether the previous data is overrides or EXE1 waits for some time for wcf service.

I want to control this condition, until first data is not read by wcf EXE1 must have to wait for some time.i want to send data synchronously to EXE2.

How can I do that?

As its named as PIPE data that goes in first comes out first and data in pipe is not overwritten.

For waiting to write before other end reads it: You better of controlling how much you read at other end (eg passing message length as first byte(s)). So reader knows how much it should read and reads only that much a time from pipe.

you would have to make WCF service acknowledge a particular set of bytes that its going to receive.

So Exe1 sends 10 bytes and waits for WCF to acknowledge it.

If WCF doesn't acknowledge, Exe1 would resend it(timeout)!

If WCF acknowledges it,you would send the next 10bytes and so on.....

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM