named-pipe | A cross-platform named-pipe implementation | Machine Learning library
kandi X-RAY | named-pipe Summary
kandi X-RAY | named-pipe Summary
This is the repo for an ISP I’m doing on building a basic cross-platform named-pipe implementation. One of the design goals is that it eventually be included in the Boost.Interprocess library.
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 named-pipe
named-pipe Key Features
named-pipe Examples and Code Snippets
Community Discussions
Trending Discussions on named-pipe
QUESTION
I'm getting used to win32 API shenanigans but it's tiresome, the problem I face this time regards the assignemt of a name of a named pipe, this is what I'm doing:
...ANSWER
Answered 2021-Jun-07 at 12:03LPTSTR
is the non-const version. You're trying to acquire a non-const pointer to a string literal.
This used to be valid C++ (it still is valid C, hence the sample), but it was very dangerous, so they made illegal in C++11. You either want:
QUESTION
Using C# 8+ with nullable context enabled, I have a method which returns
- An enum representing various error codes, or success;
- An object (if success) or null (if error)
as a ValueTuple. Aside from the null-forgiving operator, is there a way I can tell the compiler that the object is not null if the enum value indicates success?
...ANSWER
Answered 2021-May-15 at 23:28No. At this time, the MaybeNullWhen/NotNullWhen attributes only work to signal that the null state of an out
parameter depends on a bool
return value.
There is currently no plan to allow the null state of a variable to depend on the value of an enum return value, for example.
There is also no plan to allow an interdependence between the elements of a tuple return value, i.e. the (object? result, bool ok) Method()
pattern. If you are interested in such functionality getting added to the language, feel free to start a discussion on how it would work at https://github.com/dotnet/csharplang/discussions.
QUESTION
I wrote the client and server side based on the documentation Named Pipe Wrapper, but unfortunately only server.ClientConnected runs and server.ClientMessage and client.ServerMessage do not run. How can I push a message from the client to the server And vice versa?
model :
...ANSWER
Answered 2021-Apr-04 at 18:26Based on documentation
To test the performance of the pipe, it is better that you convert the ExampleCLI
project into two client and server projects and move the SomeClass model into a new class library. Your problem occurs when the model is serializable. That is why the server.ClientMessage
, and client.ServerMessage
are not called.
QUESTION
I am writing a C++ program that makes use of named pipes on Windows. I can create and work with them quite fine. The only piece missing to the puzzle is a function to check for a pipe's existence.
Coming from the Unix world I originally tried std::filesystem::exists("\\\\.\\pipe\\myPipe")
but this is not reliable and often errors with ERROR_PIPE_BUSY
.
While searching for an alternative way to check for a pipe's existence, I stumbled upon this issue on GitHub (Boost process) and from there I take it that Boos process circumvents the problem by using a special naming scheme and a counter and then keeping track of that internally (only seems to work for pipes created via Boost process though).
Furthermore according to How can I get a list of all open named pipes in Windows? it seems that there are ways to list the existing named pipes. These solutions are not using C++ though and I did not find a way to port that over.
After having read the documentation of CreateNamedPipe, I now assembled the following solution to my problem:
...ANSWER
Answered 2021-Mar-24 at 18:08std::filesystem::exists("\\\\.\\pipe\\myPipe")
returning ERROR_PIPE_BUSY
means it is using CreateFile()
to actually connect to the pipe. It is not unreasonable for an exists()
implementation to attempt to open the requested file to check its existance.
Per the CreateFile()
documentation:
If there is at least one active pipe instance but there are no available listener pipes on the server, which means all pipe instances are currently connected,
CreateFile
fails withERROR_PIPE_BUSY
.
Which means the pipe does technically exist, it is not ready to receive a new client at that moment.
In the link you provided, many of the solutions provided suggest using .NET's System.IO.Directory.GetFiles()
method to iterate though the contents of "\\.\pipe\"
. This answer shows how that call translates into Win32 API calls using FindFirstFile()
and FindNextFile()
. You can easily do the same API calls in C++, eg:
QUESTION
Trying to follow GNU Parallel as job queue with named pipes with GNU parallel 20201222, I run into issues of parallel not executing the last commands piped into it via tail -n+0 -f
.
To demonstrate, I have 3 terminals open:
...ANSWER
Answered 2021-Jan-13 at 13:40From man parallel
:
There is a a small issue when using GNU parallel as queue system/batch manager: You have to submit JobSlot number of jobs before they will start, and after that you can submit one at a time, and job will start immediately if free slots are available. Output from the running or completed jobs are held back and will only be printed when JobSlots more jobs has been started (unless you use --ungroup or --line-buffer, in which case the output from the jobs are printed immediately). E.g. if you have 10 jobslots then the output from the first completed job will only be printed when job 11 has started, and the output of second completed job will only be printed when job 12 has started.
In other words: The jobs are running. Output is delayed. It is easier to see if you instead of using echo
in your example use touch unique-file-name
.
QUESTION
I am trying to auth users with gssapi using mariadb gssapi plugin in php on a local installation with xampp. I have set up xampp and a local installation which works. Now i want to connect to the db by using the windows ldap user and gssapi authentication.
the problem was somehow discuessed here, but without any results: GSSAPI-Auth with PHP to MariaDB (Windows)
the gssapi authentication for the mariadb seems to work. I created a user in phpmyadmin with authentication method = gssapi. In the CLI i am able to connect, see picture below:
Successful mysql connect with domain user
now when trying to connect with
...ANSWER
Answered 2020-Oct-15 at 12:09The difference between your client and PHP is, that the client is linked against libmariadb (and is therefore able to load the auth_gssapi_plugin, while mysqli is either linked against libmysql or PHP's internal mysqlnd driver.
Beside Kerberos/GSSAPI MariaDB also provides ed25519 and pam authentication (via dialog plugin) which is not supported by libmysql and mysqlnd.
Building ext/mysqli against MariaDB Connector/C unfortunately doesn't work and recent pull requests which fixed that problem were rejected.
QUESTION
Is there a simpel way to get all open named pipes in c++, like there is in c#?
...ANSWER
Answered 2020-Sep-08 at 14:11Since you can't use C++17, you'll need the WinAPI way of iterating over a directory. That's FindFirstFile
/ FindNextFile
. Despite the name, that will also find pipes if you look in \\.\pipe\
.
QUESTION
This is how my sql my.ini file looks like. I wanted to enable inifile but ended messing up the file. Now when i try to open mysql command line it throws 'fatal error in default handling' And also says option without preceding group and it closes instantly. I made a video of what it does. Please help me what to do Make it back normal. my.ini file is attached below
...ANSWER
Answered 2020-Jul-17 at 20:14Consider using filename strings in your configuration file without the surrounding " marks.
For instance, general_log_file="A.log"
could be general_log_file=./general.log
to be descriptive of the log filename in Windows in your current datadir
There are others that do not need surrounding " marks.
QUESTION
I wrote a piece of code with a IPC purpose. The expected behaviour is that the code reads the content from the named-pipe and prints the string (with the Send("log", buff.String())
). First I open the named-pipe 'reader' inside the goroutine, while the reader is open I send a signal that the data can be written to the named-pipe (with the Send("datarequest", "")
). Here is the code:
ANSWER
Answered 2020-Jun-06 at 04:44The writer should close the file after it's done sending using file.Close()
. Note that file.Close()
may return error.
QUESTION
I'm trying to interact with pipes: C# server -> C++ client
I don't need something really complex, if the server is able to send data to client it's more than enough
I don't know why I'm getting this error: Could not open pipe. GLE=2
I'm using Microsoft examples C++ client and C# server
This is what I'm trying to do:
C# SERVER
...ANSWER
Answered 2020-May-19 at 03:13The pipe name you used on the C++
side is incorrect. It should be: "\\\\.\\pipe\\mynamedpipe"
.
Also, change the C#
side to the following:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install named-pipe
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