Click here to Skip to main content
15,749,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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?
Posted

1 solution

Pipes are streams. Writing data into a pipe which has data pending a read shouldn't overwrite anything, unless you filled the send buffer.

Your service and EXE2 should keep an eye on the pipe and read data out of it regularly. A service is spending most of its time sitting there awaiting requests anyway, so you should be able to use the normal asynchronous stream reading (e.g. Stream.BeginRead[^] or the new .Net 4.5 ReadAsync[^]).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900