Windows Named Pipe Support in Linux [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I'm looking at a project which will require inter-process communication between a legacy Windows application using named pipes, and a new service running on a Linux server. The windows application cannot be changed. Does anyone know if there is a Linux library available that supports Windows named pipes? Or even better, can anyone recommend a library they have used for this purpose?

Windows and Linux named pipes are different animals. If an interop solution exists you are going to be one of a very small population of users.
You might be better off writing a proxy on the Windows side to map between Named Pipe and socket, and connecting this to a socket on the Linux end. This provides you a useful networked interface on the Linux side going forward, and removes what might be a world of Named Pipes interop hurt from the picture.
If I was doing this I would try to produce a simple passthrough proxy in C# (managed code) as a proof of concept. Can always convert to native code (Win32/C++) if throughput does not measure up. There is some sample C# code here that might be a useful reference.
Here is background on the nuances of Windows vs Linux named pipes.

I bet Samba/Winbind contains highly relevant code. Not sure how reusable it is, though.

Related

Cortana from Win32 [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
This is a rather directionless post I'm afraid an I apologize. I'm trying to figure out how to use Cortana from win32 (non universal) applications. I found this link but I can't tell if there is a way to access these APIs from non-managed code. That sent me on a rabbit trail to find out what this UniversalApiContract stuff is and how to use it form native code but so far I am coming up very empty.
Could someone please provide me with some direction!! What do I even need to search for to begin to learn how to access these APIs natively? Is there some reading on windows runtime that I should undertake?
Thanks in advance and again I apologize for the general questions - not sure where else to turn.
[Expressed displeasure over how many people voted to close the thread without any useful response or suggestions]
Now, on to science.
After spending some time with this it would seem this is not possible. I was able to call the API from Win32 by using the Visual C++ Component Extensions. This allows you to use windows runtime and CLR like concepts but results in purely native code. As a side note, since I wanted to link this with an application that I did not want to recompile with this extension, I did this in a DLL and delay loaded it.
Unfortunately the call to install the voice command definition file failed with a COMException: The process has no package identity. This means I can successfully call the API, however it requires a package identity - in other words, it must be called from a Modern/Store/Universal App context with an application identity.
The only way remaining to me seems to be to use the Cortana background API to interface with a modern app I write in the background, and use it to broker calls from my Win32 app to Cortana through some sort of custom communication. Icky.
I hope this helps save someone else time.

Any opensource C/C++ Libraries/Frameworks for RPC over pipes/internal linux sockets? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I am looking for a lightweight opensource library/framework preferably written in C/C++ (it doesn't have to support x languages and should be easy to understand and use.) which can be used to make RPC over internal linux sockets or pipes.
In other words I am looking for an RPC possibility which can be run over some of the linux IPC mechanisms.
Thanks
Look at msgpack-rpc. It's easy and very simple RPC implementation.
Not exactly lightwieght, but Dbus is an answer and it's standard on most linux distributions these days.
I guess you don't want any fancy framework and can handle simple library calls. The linux rpc library should then be sufficient: See the manpage, and maybe this tutorial.
SUN ONC RPC library for Linux is a good solution. Also you can use the rpcgen compiler to generate server and client stubs.
All you have to do is to write an .x in the RPCL language an compile it using rpcgen.
Here is an example that I have published in github: https://github.com/issamabd/SDL-PPONG
It uses RPC calls to connect two PingPong players over the network.

Async C++ Communication Library for Linux (and Windows) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm looking for a communications library (socket, possibly IPC as well) for usage in C++ on Linux, if possible also on Windows if it's platform independent.
It should be async. I tried the Boost Asio Library, but due to limitations we can't find a solution for, we cannot use the Asio library in our solution.
It should be an implementation where no external binary is needed to be executed separately to act as an independent server.
Does anyone of you know something that might help me with these constraints, as I don't want to implement the communication from scratch.
Edit:
One more limitation I forgot to mention. The communication should allow implementation independent client and server, so the messaging system should deliver and receive single messages/strings to and from dedicated sources (server s sends string str to client c)
Edit 2:
The Boost limitations are that with the current system, Boost Asio compiled with the MPI compiler of either MPICH2 or openmpi, especially when using mpi calls, loses several messages when trying to communicate over asio.
Take a look at ZeroMQ, a.k.a ØMQ.
Lot's of free stuff available, look for anything implementing AMQP (for example, and not limited to: Apache's attempt - ActiveMQ, ZeroMQ as listed above, rabbit mq [which is more complete than zero] and even Red Hat are in the game with Red Hat Messaging).
Lot's of pay for solutions ranging from Tibco to 29 West, Tervela to Solace - this depends on how much you want to fork out...
Other options, I really like include OpenDDS - different to AMQP, but again highly scalable and very good performance. (forgot to say, OpenDDS uses ACE under the covers...)

Register hotkeys in Linux using library for c++ [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
are there any libraries for Linux wrote with C++, that could register global hotkeys for my application? Thanks.
You'll have to provide more information.
In Gnome, the global functionality varies by window manager. Metacity has configurable global shortcuts, as do Compiz and Sawfish, and they're all configured differently. Xhotkeys can also be used for the same functionality. However, these are all limited to starting applications only.
Within the KDE application framework, KAction can register global shortcuts which perform actions inside your program. These are actually handled by a module in kded (launched on demand), so they work even outside of the KDE desktop environment.
If you don't use the KDE framework, but are still using X11, you can use the xlib API to call XGrabKey on the root window.
For shortcuts that work outside of X, as long as you are running as root (or permissions are changed permissively) on a 2.6 kernel, you can directly open /dev/input/event*, and poll for the desired key events.
I wrote a simple C library a while back to make registering global X11 hotkeys a little less painful. There are some examples with the code. You can get it at:
https://github.com/jwmcode/xhklib/

Could anyone suggest a good packet sniffer class for c++? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
Could anyone suggest a good packet sniffer class for c++? Looking for a easy insertable class I can use in my c++ program, nothing complicated.
You will never be able to intercept network traffic just by inserting a class into your project. Packet capture functionality requires kernel mode support, hence you will at the very least need to have your application require or install libpcap/WinPcap, as Will Dean pointed out.
Most modern Unix-like distributions include libpcap out of the box, in which case you could take a look at this very simple example: http://www.tcpdump.org/pcap.htm
If you're using Windows, you're more or less on your own, although WinPcap programming is extremely similar to libpcap programming (unsurprisingly, since it's a libpcap port to Win32.) The SDK can be found here: http://www.winpcap.org/devel.htm
At any rate, no matter the operating system, you will need root / Administrator access to actually perform a capture. Just using the library to replay or analyze precaptured data doesn't require any special privilege, of course.
You'll need to say something about your platform, as this is a platform rather than a language thing.
But assuming you're on something common, look into pcap or winpcap.
Microsoft Network Monitor has a packet capture and analysis API, see the netmon blog for some basic info.