C# mono inter process, inter application cross platform messaging implementation. (How to) - cross-platform

I am developing applications and c#, I at the moment, I work on projects for Windows Platform only. However, I am planning to move into using C# mono to make my programs be able to work with linux, mac-os and windows.
One of the feature I am implementing in my program is the ability to communicate between them (ie. A Console type program that can communicate and interact with GUI Program by sending commands and receiving reply messages, logging messages, signals,.etc). Back in windows dotnet framework, I am looking at anonymous pipes, but now, I am checking if Mono.Unix.UnixPipes will do the job for me and will let me implement inter process messaging with very little to no adjustments at all under linux, mac-os and windows.
I am a little bit new to this kind of feature, and i am now reading into the documentations (however, class and objects documentations are not helping me so much yet). I am also browsing to some of the inter process messaging questions that are posted here in stackoverflow.
If anyone has a link to a tutorial kind of document or example on how to do this, it will be a great help. please help?
thank you.

I highly recommend running a mongodb (easly scalable from a dev boxes to hundreds of servers) and using the library https://github.com/dominionenterprises/mongo-queue-csharp on top of it for the messaging. It has the ability to query for messages which enables some really nice patterns. Also its compatible with mono ! Also has some other languages if needed down the road.

Related

Networking in Mono

All,
I'm attempting to estimate the effort to port an app developed on Windows (.NET) to Linux (Mono). I came across the MoMA tool, which attempts to look through my .exe and find potential areas of incompatibility. Most of my issues appear to be centered around get/set of network settings, getting network info, etc. (Object ManagementBaseObject.get_Item and set_Item. etc).
In almost all of the cases, the Mono functionality is listed as "ToDo". For estimation purposes, is it safe to assume most/all of these have some kind of workaround? I would imagine this type of basic networking support must be included in the latest version of Mono. Or should I assume none of this is currently available and I would be stuck waiting for it to be implemented (or be forced to implement it myself)?
Thanks,
Dan
First,see Mono Compatible Networking/Socket Library. Also,take a look on Cross-Platform Network Applications with Mono. You can start with C# Network Library.

Load-testing xmpp server

I am looking for a tool capable of generating multiple Xmpp connections to load-test a XMPP server with a secure connection, especially starttls.
For a xmpp plain text authentication I had used jab_simul(followed this tutorial) and tsung both with success.
But I was unable to use the tolls above for the starttls,I peeked into the code of both tools and tried different configurations of the tools.
Another option I am pondering is using a xmpp library like eXmpp and make a specific load-testing tool myself with, instead of altering jab_simul (C software with comments in language i do not understand) or altering tsung(all purpose load-testing tool, so lots of place where you can go wrong).
short-story - I am looking for a tool or advice to stress-testing/load-testing a xmpp server.
We are facing exactly the same challenge right now. After deep consideration we found out that only especially build software can deliver the load we want to test. (Remember, you can configure ejabberd to something very specific :-)
For that we developed a small library called xmpp_talker https://github.com/burinov/xmpp_talker (Apache Licence) which is a kind of xmpp client made as a gen_server. I find it is a very nice starting point to build any kind of load simulation software. There is also echo_worker example included. So, you have good base to start. At the moment xmpp_talker is suited for exmpp 0.9.7. As far as I know in a few days will be out version 1.0.0. (or 0.9.9?) There are many bug fixes (trust me you don't want to know about them). On monday I will release xmpp_talker for exmpp 0.9.8 with proper service interruption handling.
In case you deside to go the same way xmpp_talker could be useful for you.
Added: Here is also great article that is realted to the topic: https://support.process-one.net/doc/display/EXMPP/Scalable+XMPP+bots+with+erlang+and+exmpp
There's also the recently started XMPP benchmarking project called xmppench which aims to be a high-performance benchmarking tool simulating some reasonable use cases of XMPP servers. It's written in C++, based on Swiften and boost.

An good examples of a client-server setup in vb.net?

I'm trying to learn how to do some very simple client-server application programming.
Basically, I want to make a program (the server) that listens and waits, and when a commend is sent it will run a batch file or execute a line of code.
The client will just ask for the ip and send the command when a button is pushed.
Shouldn't be too hard right? So what are some good resources that you've used to get started?
You probably want to dig into WCF, the Windows Communication Foundation. That's the state-of-the art for writing .NET components that need to communicate over some kind of network. Googling for wcf introduction yields various tutorials and examples to this topic.

Should I use CORBA, MessagePack RPC or Thrift, or something else entirely?

I'm writing software for a new hardware device which I want any kind of new third-party application to be able to access if they want to.
The software will be a native process (C++) that should be pollable by 3rd party games and applications that want to support the hardware device. Those 3rd party apps should also be able to receive events from the native process, on a subscribe basis. So aside from the native process, I'll also supply "connector" libraries to the 3rd party developers, for all platforms/languages that they might choose (Java, C++, Python etc.) to embed in their apps so they can easily connect to the device with hardly any extra code needing to be written by them. I want to target all desktop/laptop OS platforms, and have a pretty good idea of what functions I want to expose, but ideally I don't want to be too stuck (i.e. I want it to be elegantly scalable from both client and server perspectives).
I'm looking for reliability going forward, performance, maintainability going forward, and cross-platform/language flexibility going forward, and ease of development, in that order.
What should I use?
CORBA, MessagePack-RPC, Thrift, or something else entirely?
(I've omitted ICE because of it's licensing)
Thrift or Message Pack is the best option going forward. Both are sleek, light weight and do not add much latencies to your process. They have support for most of the common languages, and are in Active Development. At the current stage I would prefer thrift personally but message pack does seem to promise a lot of features.
Thought thrift might not be as windows friendly as we want but people are using it on windows.
This is a starter guide for thrift on windows.
http://wiki.apache.org/thrift/ThriftInstallationWin32
Only installing and getting the Thrift compiler can be troublesome on windows. Using the generated files depend on the language you choose and lot of the languages have good support to run the files by importing thrift libraries. (Java it is very easy, MAVEN artifact)
There is a discussion on the RPC frameworks available at RPC frameworks available?
CORBA according to me is old cumbersome and very heavyweight.
If ancient and heavyweight don't put you off, obsolete definitely should. Regardless, I can tell you what we've been using Google Protocol Buffers at work recently, and they're pretty easy to use.
From the developer's perspective, all you need to do is have a build of GPB (which really isn't that difficult), and then it will generate source files for you. The end result is a cross-platform binary message transport message passing interface (think XML and limited RMI, not MPI-like functionality).
We use it on Windows to talk to an Arm-based Linux system (TS-7200's from embedded arm) running the same software. to my knowledge, it is compatible with many languages.
CORBA is the only free "RPC" thing that would work for my system right now, even though it scales very badly. Thrift isn't Windows-friendly yet. Neither is MessagePack-RPC yet available in all languages and OSs, even though it's still in development. If CORBA was elegantly scalable it probably wouldn't have become obsolete at all.
Protocol Buffers and messaging would work, I'd have to develop a both a client and service implementation for every platform/language. It would also be very scalable. I've decided on this.
I'm currently using Apache Thrift for a Hospital Manager project. It is better than CORBA in many areas, not to mention it is lightweight and much easier to implement and understand. The learning curve for Thrift is definitely subtle compared to CORBA, but the documentation for Thrift is the worst thing.
I'm using a Ruby Thrift server to which Obj-C and Java clients connect. The Thrift parser or "compiler" does a pretty good job generating source files for the languages you want, although it is far too verbose. I would definitely look into implementing Thrift, or Google ProtoBuffs if I was starting a new project, since CORBA is really outdated, and might not implement new technologies in the future, not to mention that there are many vulnerabilities and exploits targeting CORBA that will not get patched since it's not in development anymore, presenting some serious security holes on your new project.
Thrift supports many programming languages: C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Objective-C, JavaScript, Node.js, Smalltalk, OCaml and Delphi as of this writing. Supporting multiple languages is key, I think, for the purpose of your project.

Application framework to develop web and desktop applications?

Recently I was asked by someone if there is such a magic framework that will allow one let's say to design and build once a single library of controls and then use them separately to build web and desktop applications.
Does Google, Microsoft or other company have such a RAD framework and tools?
Thx
Depends on how you define a Web App. If you consider RIAs to be Web Apps, then yes...
Microsoft has Silverlight and Adobe has Flex/AIR.
Well, you can always go and look for adobe flex, adobe flash or even microsoft silverlight, which in the next version will support desktop applications as well.
Other types of frameworks currently do not build so well under desktop/web environments.. Take .NET for example, which can be used in so many set of environments, but there are limitations if you want to use it for mobile, web, desktop or XNA, everyone has his own set of tools.
That is mostly resumed in the capability of the desired environment, since you can browse a web page in an iphone, which does not have the same capabilities of a desktop or even laptop PC.
Seva is telling you how this is normally dealt with. MVC is a good start.
The Eclipse foundation offers Rich Client Platform vs Rich Ajax Platform - one allows you to build desktop apps, the other web-based apps, all using SWT concepts. I wouldn't describe it as magical though - the reality is it is much more difficult and I would not recommend RAP.
Adobe has AIR, and Google wants everybody write HTML5+JavaScript. both Chrome and FireFox can run those as standalone apps.
Were such thing to exist, it would produce lousy desktop apps and lousy Web apps. The underlying platforms and ideologies are too different. You'll do better by isolating as much of business logic away as possible, then building two separate clients.
EDIT: assuming that by a "Web app" you mean an HTML-based app, as opposed to something that happens to execute within a browser. For the latter option, you can have Flash, Silverlight, Java Applets, ActiveX controls... And for the vice versa, you can have a desktop app that opens a Web browser control and runs a Web app in it. :)
Microsoft has a Smart Client Factory that has a lot of built-in guidance packages that make development fairly quick and standardized.
http://msdn.microsoft.com/en-us/library/aa480482.aspx
It is entirely possible that I misunderstand this question, but if all you need, is the ability to seperate models an business logic into some kind of reusable library, just about any programming platform/language will do.
Java: keep models and business logic in seperate project, compiled to jar
.NET: keep models and business logic in seperate project, compiled to DLL
Python, Ruby, Perl: keep models and business logic in separate directory, and include as module
What are the requirements for the desktop application? On which platforms should it run? If Windows only, .NET seems like an obvious choice, otherwise Python and Qt or Java if you like to Swing.
I also would go for a Webservice and implement as much Business-Logic as possible in the Service. You can then build a very small Clinet in Html/JS, Java, .Net or Whatever.
You should choose that Framework you feel most familiar with.
If you are a .Net-Developer you can develop a WCF-Service (is also great with WP7).
For Java, i would choose Google-App-Engine or the Play-Framework.
And of course you can make a PHP-Webservice, for examble with the Flow-Framework
Check CrossUI RAD tool. It enables developers to rapidly develop and package the exactly same code and UI into Web Apps, Native Desktop Apps(Windows, OS X, Linux and UNIX) as well as Mobile Apps.