xgrr.de – the whole not the half

things, thoughts and stuff out of life, daily business and computer science


Java and C# served well done

java-and-c-served-well-doneFor a new project of mine I was looking for a messaging subsystem for C# which I was able to use from literally everything else. When working with C# you will hear that Microsoft Message Queue is your choice. That’s about right. But then you’re bound to a specific product and the use with PHP is very limited or impossible from Unix systems.

My second choice was JMS. You might ask how do I get JMS working with C#. But actually thats not even that hard. Following the small how to OpenJMS from C# which I adapted for Visual Studio I got OpenJMS working with C# quite easily.

But that’s not all. I was also able to get Java libraries as assemblies into .NET and am actually able to use the full power of some of the libraries from within C#. This means you can combine the best of both into your programs. The whole thing has only one little drawback as your C# program needs to run a embedded Java Virtual Machine the memory footprint will be not as what you’d expect of a simply .NET application.

Nonetheless. I got JMS running with C# and could even implemented the MessageListener classes with C# and hook them into my JMS listener. Furthermore you would be able to use log4j for instance (nobody would as there is a native implementation called log4net available).

Realized a good thing…

When I started playing around with the library tool we have here at HP I browsed a book about qmail. A mailserver I’m involved with for about five years now but still I discovered something very, very nice about the used architecture. The most parts of qmail aren’t able to do anything on the network. This is done by external tools like tcpserver. There are also other programs which enhance tcpserver to use ssl encryption.

For a current project I created a C# program which transmits control information to slaves via ssl. Currently I programmed the network part and all the communication in my executable. But due to limitations of C# on Linux I wasn’t able to use SSL certificate authentication from within C# yet. Maybe I’ll adapt the tcpserver idea to simplify my application…

Mono: Private key for SslStream.AuthenticateAsServer()

Argggg. It’s bugging me for weeks now. I started to program an application on Windows using C#. Now as the time is ready I want to port it to Linux using Mono. From the function view everything is fine. But when it comes to details there is much work to do for the Mono project especially regarding documentation.

On Windows my applications loads the certificate and its private key from the Windows Store. On Linux this is simulated by Mono. But when I import my certificate it doesn’t import it’s private key which leads to failing authentication. This sucks! Hope to find the solution quickly as this stops my development since weeks now.

C# does not know signaling

Currently I’m trying to code a new part of a project for my company called petliADMIN. It consists of two parts. A webapplication written in PHP which controls a C# based daemon running on the nodes which petliADMIN is about to administrate. The result of the project is something linke Webmin but with a node system with no need for an webserver on all nodes.

Now I’m encoutering a HUGE problem. It seems that C# does not know how to handle signals produced by the linux system it’s running on. I planned to run the application under Daniel J. Bernsteins’ daemontools which are running on serveral servers of mine. Now I have to figure out how to emulate signaling in C#…. :(