NamedPipes | A pattern for client/server communication via Named Pipes | Runtime Evironment library
kandi X-RAY | NamedPipes Summary
kandi X-RAY | NamedPipes Summary
A pattern for client/server communication via Named Pipes via C#
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of NamedPipes
NamedPipes Key Features
NamedPipes Examples and Code Snippets
Community Discussions
Trending Discussions on NamedPipes
QUESTION
We have an application written in c that sends events/notifications to an application written in c#. Both applications run on the same linux computer.
The C application:
The C application is Asterisk and we modified the source code (it is open source) so that it can send events to our dotnet console application. The way we currently send events is simply by appending text to a file. For example this is how we send an event that a new peer (ip-phone) connected:
...ANSWER
Answered 2020-Oct-17 at 02:13I would use an AF_UNIX socket connection.
QUESTION
I am using jna
module to connect two processes that both perform FFMPEG commands. Send SDTOUT
of FFMPEG command on the server side to NampedPipe and receive STDIN
from that NampedPipe for other FFMPEG command on the Client side.
this is how I capture STDOUT
and send into the pipe in server Side:
ANSWER
Answered 2020-Jul-26 at 08:38Seems like you're constantly polling process states stdin on server side without waiting for any events or sleeping the thread. Probably you want to take a look here: Concurrent read/write of named pipe in Java (on windows)
Cheers!
QUESTION
I've set up a WCF NamedPipes Server/Client pair of applications but when the Host stops and calls ServiceHost.Close()
it doesn't seem to appropriately cleanup the object from which the Host was created (using an object rather than a type to instantiate the host).
The server application code is as follows:
...ANSWER
Answered 2020-Apr-30 at 07:13Your output is a ServiceHost
which is not a custom type you create.
Therefore it will not automatically call IMyServer.Dispose()
.
Instead of returning a ServiceHost
, create some kind of adapter that will manage the ServiceHost
and your IMyServer
instance and return it to the void Main()
method.
Then, simply add a finally clause (or implement IDisposable
and use using
) and call your adapter's dispose, that will call serviceHost.Dispose()
and myServer.Dispose()
.
QUESTION
I have an Enterprise LOB scenario, where I need to communicate between my Sideloaded UWP app and multiple console applications which are developed by third parties. Internally, these console apps will be interfacing with COM ports and hardware devices.
Can I use App Service to communicate between UWP and out-of-package Console App?
Further more, the communication must be two way and asynchronous, expected flow:
- UWP -start-console-app-expect-no-response-> Console App (How to achieve this step without desktop-bridge?)
- UWP <-send-data-expect-no-response- Console App
- UWP -send-data-expect-no-response-> Console App
I have already referred the links below but according to them "Windows Application Packaging Project" is a must.
- https://stefanwick.com/2018/04/06/uwp-with-desktop-extension-part-1/
- Communication between UWP and Non UWP app
Please do suggest if there are any other alternatives too.
EDIT:
It is possible to start out-of-package Console Apps from UWP using 2 methods:
- Create a package with a Console App which can launch any other Console app(s). Refer: https://stackoverflow.com/a/49340814/10224384
- Launch Console App via protocol URI. Create a URI protocol to Console App: https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa767914%28v%3dvs.85%29 OR https://www.meziantou.net/registering-an-application-to-a-uri-scheme-using-net.htm
However, it is not possible to communicate between the out-of-package Console App and the UWP via the App Service. Even though, the Console app has reference to Microsoft.Windows.SDK.Contracts nuget package and can access AppServiceConnection API since AppServiceConnection class has the DualApiPartitionAttribute. The connection cannot be established with the AppServiceUnavailable Error.
Hence, Now I'm trying a new solution with option 1 from above as mentioned here: https://docs.microsoft.com/answers/questions/1166/how-uwp-can-communicate-with-windows-service.html?childToView=1211#answer-1211
Fallback options that need investigation:
- WCF Http/NamedPipes
- UWP starts Console App, Console App responds by invoking a Launch by URI protocol (Of course the UWP needs to register the Protocol)
ANSWER
Answered 2020-Mar-04 at 00:30AppServiceConnection cannot be used to establish communication between out-of-package Console App and UWP, see the updated question.
From comments, I think this can be achievable, but it should not be through the COM port, but to establish AppServiceConnection
.
Please refer to this document to create AppService
for UWP applications. If your console app can create an AppServiceConnection
, then you can establish a connection with the UWP app and transfer data.
AppServiceConnection
is a two-way communication. After the connection is established, the console app and UWP app can send information to each other.
QUESTION
I am developing a software in matlab appdesigner that will run two functions simultaneously under parforloop. The first function has a NamedPipe object and the error is: Functionality not supported with figures created with the uifigure function for the app variable and also unable to load .Net object . What's the problem with NamedPipe object under parforloop? How can i run namedpipe communication with parallelism in matlab appdesigner? Here is my code
...ANSWER
Answered 2019-Jul-22 at 09:25Finally, I have found the solution. So i am posting the answer for future help. parallel.pool.DataQueue should be used here. Here is the full code of appdesigner. For Full Server and Client code you can also check this github repository: Named Pipe Parallel Communication
QUESTION
I decompiled a .NET Application to write my own Injection Software. A Thread Error don't want to get removed. I tried everything but it keeps telling me that something is wrong...
...ANSWER
Answered 2019-Mar-04 at 19:25I think you are getting the The call is ambiguous between the following methods or properties: 'Thread.Thread(ThreadStart)' and 'Thread.Thread(ParameterizedThreadStart)'
error with this.
As you correctly noted, the compiler can't distinguish what type the Thread
constructor parameter is. ParameterizedThreadStart is used if you pass a parameter to your delegate when calling the Thread.Start
method. Your code does not do this. Thus, you need a ThreadStart delegate here. Its syntax is
QUESTION
I am working on an inter-process communication between a .net (v4.5.2) and Javascript node.js (v8.9.0) application. I want to use Windows named pipes for this (and only named pipes). For the Javascript application, I am using the named-pipes package (v0.0.1) I am able to establish a connection between the two applications which tells me that I am not completely off base here. I would expect to see the data event being triggered in the JavaScript application whenever I am writing a string to the NamedPipeServerStream but no data is received. I can not receive any data. Here is the code for .net and the JavaScript application. Any ideas, why that the data event is not triggered?
.Net Code
...ANSWER
Answered 2018-Apr-03 at 12:55There are two reasons, why the data event is not triggered:
The "named-pipes" package is internally creating sub-pipes. This package is easy to use, if you create the server with the same package. But in this case the pipe server is created via a .net application. So in the javascript code you better use the "net" module of Node.js to connect to the server.
In the .net application you should not create a new StreamWriter. Just use the write method of the server instance. The NamedPipeServerStream implements IDisposable, so it is better to put it in a using block.
.Net Code
QUESTION
I have a client and a NamedPipe server. The client and the server run on distinct Windows services. On the same machine the connection works perfectly. But when attempting to access the server from another machine, an exception of type UnauthorizedAccessException is thrown (access is denied). I researched several posts and included AccessRules on the server, but it did not work. The client machine user does not exist on the server machine. Is there a specific / AccessRule setting for this case? Does anyone know the solution?
Server:
...ANSWER
Answered 2018-Jan-20 at 00:05I don't know why this question was downvoted - I corrected that.
I tested this in my lab on two Win 7 machines with different users.
The remote named pipes in Windows are over SMB / CIFS. So normal logon restrictions apply.
I was able to get this to run successfully if I changed in the local security policy:
Security Options
Accounts: Guest account status – change to Enabled
User Rights Assignment
Deny access to this computer from the network - remove "Guest"
Warning
This is not a good idea to do this. I only did the changes to verify this and changed them back immediately.
There is also an option in the local security policy for adding named pipes which can be accessed anonymously, but this didn't work in my case. One had to investigate into this.
In my opinion, using named pipes for un-authenticated access is not the best solution. Normally, I prefer authenticated connections, but in my case most of my development is in an corporate intranet with all machines in an Active Directory environment with AD users, so this is easy.
Perhaps you can use the old trick of using the same user name with the same password on both machines, this will work without the above mentioned policy changes.
QUESTION
I am using NamedPipes to communicate between different modules of our windows application. At one point it is possible that a read operation could take long time so we would like to add a timeout. I added the OVERLAPPED-flag like this:
...ANSWER
Answered 2017-Aug-15 at 12:55In your code, the FILE_FLAG_OVERLAPPED
is in the dwDesiredAccess
parameter, but it should be specified in the dwFlagsAndAttributes
parameter.
So, this might work better:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install NamedPipes
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page