named-pipes

WCF Multiple Apps using NetNamedPipe

↘锁芯ラ 提交于 2019-12-03 03:06:48
I am trying to run multiple WCF Service hosting apps on the same Machine. I want to run multiple Applications - not multiple services in one application. var host = new ServiceHost(typeof(MyClass1), new Uri[] { new Uri("net.pipe://localhost") }); host.AddServiceEndpoint(typeof(ISomeInterface), new NetNamedPipeBinding(), "FOO"); host.Open(); I change "FOO" for every app, but still can not start multiple Services. Guess its pretty simple, but im stuck :( Regards Approaching it like this will do what you want, I believe: string relativeUriPart = GetUniquePartFromConfigOfThisApplicationInstance();

WCF Named Pipe Security and Multiple User Sessions?

我的未来我决定 提交于 2019-12-03 02:54:33
I have setup a WPF application that is single instance using a Mutex, this allows for the application to run within each user account if you are using user switching. The application sets up a WCF named pipe so that I can communicate to the single instance from another process (i.e. when the second process runs before it terminates due to the Mutex). I would like to know if anything should be done (best practices) to secure the named pipe? Also I would like to know if the named pipe messages would reach all running processes within the system or only within current user session. If the named

System.IO.Exception: Pipe is broken

一曲冷凌霜 提交于 2019-12-02 20:31:24
I have two .NET applications that talk to each other over a named pipe. Everything is great the first time through, but after the first message is sent, and the server is going to listen again, the WaitForConnection() method throws a System.IO.Exception with message Pipe is broken. Why am I getting this exception here? This is my first time working with pipes, but a similar pattern has worked for me in the past with sockets. Code ahoy! Server: using System.IO.Pipes; static void main() { var pipe = new NamedPipeServerStream("pipename", PipeDirection.In); while (true) { pipe.Listen(); string str

Sample on NamedPipeServerStream vs NamedPipeServerClient having PipeDirection.InOut needed

强颜欢笑 提交于 2019-12-02 17:13:09
I'm looking for a good sample where NamedPipeServerStream and NamedPipeServerClient can send messages to each other (when PipeDirection = PipeDirection.InOut for both). For now I found only this msdn article . But it describes only server. Does anybody know how client connecting to this server should look like? What happens is the server sits waiting for a connection, when it has one it sends a string "Waiting" as a simple handshake, the client then reads this and tests it then sends back a string of "Test Message" (in my app it's actually the command line args). Remember that the

WCF vs. .Net Remoting

筅森魡賤 提交于 2019-12-02 15:35:22
according to this article , WCF with named pipes is the best choice for IPC, and it is around 25 % faster than .Net Remoting. I have the following code that compares WCF with named pipes with .Net Remoting: [ServiceContract] internal interface IRemote { [OperationContract] string Hello(string name); } [ServiceBehavior] internal class Remote : MarshalByRefObject, IRemote { public string Hello(string name) { return string.Format("Hello, {0}!", name); } } class Program { private const int Iterations = 5000; static void Main(string[] args) { TestWcf(Iterations); TestRemoting(Iterations); TestWcf

using pipes to channel file i/o to another process

独自空忆成欢 提交于 2019-12-02 12:56:20
问题 Just started learning/using pipes and was wondering how to route file output of an application into a pipe so that another application can use it. To be exact, I want to pipe ffmpeg's output (transcoded video data) into my application to use it. If I create a named pipe like /tmp/out.mp4 and give it to ffmpeg as output filename, ffmpeg is going to try to create this file again, probably overwriting my pipe (Or something like that). How to deal with this kind of situation? is there any general

Redirect stdout of a subprocess to stdin of 2 or more subprocesses

落花浮王杯 提交于 2019-12-02 09:30:20
问题 Basically I want to learn how to use the stdout of one subprocess (say proc1 ) as stdin of 2 or more other subprocess es (say proc2 & proc3 ) in python. Hi, I need to zcat a .gz file and use the output sent to subprocess.PIPE for both cksum (unix utility) and to line count. I can do it in bash like this... [hashroot@dev_server 12]$ zcat ABC_C_TPM_26122014.data.gz | tee >(wc -l) >(cksum)| tail -2 2020090579 112180 586 I want to do the same in python. As soon as I do this... >>> import

Read on closed named pipe blocks

谁都会走 提交于 2019-12-02 05:11:33
I am trying to read from a named pipe (FIFO) with Fortran. Reading the data works, but the Fortran program does not seem to notice when the pipe is closed on the other end; reads simply block rather than getting an EOF. Sample program: program kitten character(256) :: buf open(22, file='test') do read(22, *) buf print*, trim(buf) end do end program kitten Now with $ mkfifo test $ echo -e '1\n2\n3' >test & $ ./kitten the program prints 1\n2\n3\n as expected, but then simply hangs. Instead, the program returns an error on EOF if test is a regular file; or you change kitten to read from STDIN and

using pipes to channel file i/o to another process

核能气质少年 提交于 2019-12-02 03:00:32
Just started learning/using pipes and was wondering how to route file output of an application into a pipe so that another application can use it. To be exact, I want to pipe ffmpeg's output (transcoded video data) into my application to use it. If I create a named pipe like /tmp/out.mp4 and give it to ffmpeg as output filename, ffmpeg is going to try to create this file again, probably overwriting my pipe (Or something like that). How to deal with this kind of situation? is there any general way to divert File IO of an application transparently? (I am trying to write a video streaming server

NamedPipeClientStream throws UnauthorizedAccessException on Connect

自古美人都是妖i 提交于 2019-12-02 02:46:28
问题 I have the same problem everyone else has when connecting a "write" pipe to a running service: UnauthorizedAccessException. I tried every solution and nothing can make it connect successfully. The scenario is having a low-integrity C#/WPF app running in system tray that gets notifications from a Windows Service using named pipes and can tell the service to cancel certain operations or wait for more data (which is why it needs a write pipe to the service). Reading from service's pipe works