.NET 3.5 (C #) Named Pipes over a Network

I am trying to get .NET ( NOT WCF) with the name pipe for network communication. MSDN documentation implies that this is possible, non-trivial. But my code is:

 using (NamedPipeClientStream pipeClient = new NamedPipeClientStream(servername, "myPipe", PipeDirection.InOut, PipeOptions.None, TokenImpersonationLevel.Impersonation))

... works fine when servername = "localhost" and the pipe server is in the same field. But if it is a different machine - regardless of whether I create the server name IP address, DNS name, NetBIOS name, UNC path, etc. - means the pipe never connects. Actually this is not so, pipeClient.Connect () just sits there.

There are so many different and conflicting posts on various forums, blogs, and sites about it. Can someone set the record directly and tell me: how can I get the Named Pipe client to connect one C # application on one computer to a server with named pipes running on another machine?

+3
source share
1 answer

Are you doing this at work? Does corporate firewall or antivirus work? Check the Windows event logs and any applications in the task notification icon area on the launch bar for tips on who is blocking this.

+2
source

Source: https://habr.com/ru/post/1731459/


All Articles