Vasteras - Sweden, Belgrade, Nis - Serbia

January 7, 2009

Troxo - Software Development Company

On .NET Remoting

August 13th, 2007

Recently we had a .NET based project where we had to enable simple client to server communication. We needed a fast solution, totally embedded into applications (meaning - no IIS web services were allowed, unfortunately).

Basically, the challenge was: the main application has to provide remote access to its dynamically created objects, like in the image bellow:

Remoting Project Challenge

We found some really good articles on the net like Remoting in C# and Remoting and Distributed Computing in C#, but none explaining everything we needed - so after some digging into the MSDN, here is the solution.

"Single call" remoting creates a new remoting object for every call by the client. "Singleton" reuses the same object for every client’s call.

"Single call" remoting was not fitting our problem because we needed just one proxy object which will forward calls to internal objects.

In our project there was a small catch with the use of "Singleton". Basically, if you do not create an object before the first call from the client, the object will be created automatically (with the first client’s call), leaving it unbound to our server objects (in the image above that would mean that "remoting facade" does not have references to internal objects - Object 1, Object 2, etc.).

The solution is to create a remoting object, initialize it with references to local objects and use RemotingServices.Marshal method to bind the remoting object instance with the remoting service (like in the following example from the attached project):

Logics.Counter counter = new Logics.Counter();
Logics.RemoteCounter remotingCounter = new Logics.RemoteCounter();
//initialize remoting object with the reference to local object
remotingCounter.SetLocalCounter(counter);
//select channel to communicate
TcpChannel channel = new TcpChannel(8085);
ChannelServices.RegisterChannel(channel, false); //register channel
//register remoting service
RemotingConfiguration.RegisterWellKnownServiceType(typeof(Logics.RemoteCounter), “RemoteCounter”, WellKnownObjectMode.Singleton);
//bind remoting object with remoting service
RemotingServices.Marshal(remotingCounter, “RemoteCounter”);

The complete sample: troxosamplesremoting.zip

 

IISGuard contest over

July 19th, 2007

Out little contest has ended. We said 10 free licenses, but we made it 15. We got a big turnout which is why we added a few more licenses.

Thanks to everyone who entered. We promise to have more surprises some time down the road.

 

Free IISGuard licenses to fight malicious code

July 5th, 2007

We want to express our love to visitors to wheel.troxo.com, so we decided to organize a fun contest to give away a hundred IISGuard licenses. Ten quickest emails to info [at] troxo.com with the subject "Give me my 10 servers IISGuard license" take them away.

Update - July 09, 2007: we have already given away 10×10 licenses. Due to a high interest in this campaign, we are extending it and we will give away five more IISGuard licenses for ten servers.

Update - July 12, 2007: until the end of 10th of July we gave away five more licenses for ten installations of IISGuard. The campaign is now over, but we have given away a few more licenses to those who had applied before we put out this update.

We’ll have more surprises down the road for those who fail to reach the top 10 so don’t despair.

The ultimate goal of IISGuard is to save you a lot of time finding and isolating problematic sites that cause server-wide problems. Subsequently you can provide better response times to problems and keep your customers happier.

This piece of software comes in very handy when you take a look at a recent research from Google that subjected 4.5 million pages to in-depth analysis. The company’s Anti-Malware team looked at 70,000 domains that were either distributing malware or hosting attack code.

Websites running Microsoft’s web server software are twice as likely to be hosting malicious code as other websites, wrote Google’s Nagendra Modadugu, in a blog posting. Around 450,000 were capable of launching drive-by-downloads sites, sites that install malicious code, such as spyware without a user’s knowledge.

A further 700,000 pages were thought to contain code that could compromise your computer.

The rise in web-based malware has been aided by the increasing role the internet plays in everyday life, the report says. With the number of sites hosting malicious code on the up, combating the issues is something you do not skip today. (more…)