Interprocess Communication using Named Pipes in C# is easy, but im not exactly sure how to do this in php, or if its even possible. so i have these questions:
an answer to any of the above questions would be so helpful.. thanks :)
edit: Its a stand alone php program, not a web-based app.
edit2: The named pipe server can be in the C# side, or the PHP side, it doesnt matter. I have made C# examples for both.. but i dont know where to start for php
If it is already created then you can open a named pipe as a file using PHP's fopen
function.
In windows the pipe "file" path looks like "\\.\pipe\pipe_name", however there is an open issue in PHP which prevents this from working. The workaround is to use the computer's name instead of the dot in the path:
$name = php_uname('n');
$pipe = fopen("\\\\" . $strComputername . "\\pipe\\pipe_name", "r+");
Though I vote for sockets like Tommy recommended, they're easy, cross-platform, and inter-machine if need be.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With