4/03/2012

PokeIn and HttpContext.Current

There are some people asking "how we access to HttpContext.Current" from one of our PokeIn linked objects instances? The answer is "why you need to to that?" PokeIn allows you to access the current "realtime" version of that page but you need an access to initial phase ? By the way, If you really need a specific functionality or information available from the initial context let the support team know from the 'discussions' page.

Please keep in mind this simple fact: PokeIn lets you communicate to the client side from server side (vice versa) at any moment you want and your objects run inside a thread different than the "HttpContext.Current" one. This is why you have no access to initial context object. Obviously, you can hold a Dictionary and insert all the 'context' objects into this dictionary by their unique client ids and access them from your PokeIn objects. Also, you may remove a context object from this dictionary when an "OnClientDisconnected" message is received. OR, you may use PCache to hold client specific context object but keep in mind that user may have open more than 1 tab in a single browser window hence (all of them share the same ASP.NET session id) and also accessing to a thread object which is no longer exist may not be good idea.

3/19/2012

VisualJS.NET ShowDialog and MessageBox Tips

VisualJS.NET helps you to create UI rich ajax/websocket application easily. You just drag and drop the controls on Visual Studio and select their properties, code the events etc. as you used to develop Windows Forms applications. You may use VisualJS.NET forms on a standard web application or MVC project without dealing with special server side naming, settings etc.

Due to developing for multi-user web environment there are some differences you may need to know. On this blog post, i want to pin the differences for 'blocking actions' like ShowDialog or MessageBox.Show . Normally, when you call a form's ShowDialog method, your application waits at that point until the called form is closed. The same thing happens when you call MessageBox.Show (it is also a ShowDialog call). On the VisualJS.NET side, your application continues to operate even after one of these calls occur. It doesn't wait on a code block.

Why? VisualJS.NET & PokeIn can manage ten thousands of users same time hence it's not a good idea to keep 1 thread or more per user and keep it on hold for this type of calls. It wouldn't be scalable as much as VisualJS.NET does.

Solution is; VisualJS.NET gives you an option to define MessageBox callback function. You can also benefit from Control/Window Events (like FormClosed event)

3/07/2012

ASP.NET WebSockets for IIS 6, IIS 7, IIS 7.5 and IIS 8

Let's admit that Comet Ajax transfers take approximately 200-300ms. per request and considering the load they generate on the web server... it may not be a good approach to solve time sensitive problems with comets.

In the light of this simple fact, we have implemented very ‘usable’ and ‘reliable’ also ‘efficient’ WebSocket support into PokeIn Library. I especially, keep these words inside the single quotes because when you start using or just thinking about WebSockets, there are problems need solutions you might seriously consider but no worries, we solved the issues as I mentioned below. Please notice that, you can use all the PokeIn Library features under IIS 6, 7, 7.5 and 8 without any special requirements or extra software install.

Let’s say you just target WebSocket supported browsers. How about the millions of IE6-IE9 corporate users those have no WebSocket support or users have firewall keeping them from using WebSocket ports. Simply you need a solution that switches between Comet Ajax and WebSocket automatically. PokeIn handles this one smoothly. It checks whether the client’s browser has WebSocket feature or not and then uses the ‘best match’. Yes, uses the best match because target user may have a browser with websocket support but that specific browser version may have an issue with handling WebSocket connections or user’s firewall may not allow him to use WebSocket connections from his browser. In short, these are not a problem for PokeIn, it always creates the communication without a trouble hence this helps you to create ‘reliable’ solutions for your users.

There are concerns about WebSockets’ safety and implementation risks. Especially the WebSocket port you are going to open on your server and parallel transfers outside the current application’s domain. I must say, we considered all these possible and known issues and implemented a hybrid handshaking approach. When a user access your application, you check his credentials as you do all the time (no difference) and when you accept him/her and let him use that specific application part under his/her session, PokeIn allows and marks him/her WebSocket transfer to your application under 64 bit internal encoder and standard WebSocket SHA1. It also keeps its port from the other 3rd party requests. You won’t even realize the difference between using WebSocket or CometAjax. This hybrid handshaking system also helps you to use your existing ‘load sharing’ mechanism without a change. You don’t have to make any changes on your ‘load sharing’ system in order to use PokeIn’s WebSocket feature.

Using WebSocket feature has very special performance boost on the application’s data transfer rates. It designed just for the socket communications, and that’s why in some cases this makes it to work hundred times faster than the standard Comet Ajax. Especially when you are developing a time sensitive application like ‘Stock Exchange’, ‘online game’ etc. this difference will make much more sense. PokeIn Library’s WebSocket feature compatible to all the known browsers and optimized for performance on both client and server side.

Today, there are hundreds of commercial users using PokeIn on their solutions and I just offer you to give it a try if you never did and see the difference and how much time you can save on this important part of your development process. PokeIn doesn’t just transfer data between the sides; it also provides a very efficient way to do that by serializing your methods and parameters on both sides. This is very unique approach to .NET based Ajax/Socket solutions because you just focus on your real task.

The last thing is DesktopClient feature. We also add Socket connection feature on our DesktopClient system. You may not be a browser based application vendor but looking for a reliable, trouble free solution to keep your users connected to your server and transfer the data among them efficiently. All the above facts same in here and PokeIn gives you the opportunity to create a very efficient and secure communication to the server. It uses standard HTTP port connections when user’s firewall doesn’t allow him/her to use another port for WebSockets.

To Start, just visit the http://pokein.com

4/13/2011

Companies fail at risk management....

As Mike Myatt said; “As much as you may wish it wasn’t so, as a CEO you’re really only as good as your last decision” [1] Yes! The stakeholders can be very merciless in todays’ bloody “red sea” [2] and therefore a CEO can be. Because companies consist of people, they grow as much as the decisions and actions of that people. So, “why companies fail at risk management?” question might be nested with “why a person fails at risk management?” question or may be the right question is the second one.

The available resources always limited and whether a company or person prefers to do one which that means not doing the other one. If the choice is right, it makes the company growing, on the other hand, sometimes a company may fail because of the direct costs of a single “bad” choice or the “opportunity cost” [3] of the second one.

So, the next question might be “Who makes the decisions?” It may be stakeholders (not the project stakeholders) or CEO or group of smart people, in other words, the collective intelligence. But sometimes for some reasons our eyes cannot see the “devil”. City of Troy lost the Trojan War because of one man’s decision that was getting Trojan horse inside. One man’s single decision had set the end of the war. Besides, he was not a king or warrior. Maybe the connected couple of bad decisions led to way for the last decision and whether the first or last one, the domino effect was inevitable.

I should be mentioning the known risk management terms which I don’t found them useful, for example; Risk identification term refers to identify, characterize and assess threats. So, how a company which consist of most of the smartest people in the world identifies the threats? They may not see most of the exceptional cases and this is the reason why we backup our data even if we install most expensive security software of the planet. The weirdest thing was that the most of the well-known insurance companies were failed on latest economic crisis. So, can we identify the risks just because there are standards and well-defined terms? No.

As a result, a company or a person might fail for any reason. Unless they put all their eggs in one basket, there will be a recovery point.

“The only man who never makes a mistake is the man who never does anything.” – Theodore Roosevelt

References

[1] Mike Myatt (2010) How to make great leadership decisions (online) Available from: http://www.n2growth.com/blog/why-businesses-fail/

[2] Sun Paper: Building Competitive Differentiation International Paper Group (Online) Available from: http://www.articlesbase.com/strategic-planning-articles/sun-paper-building-competitive-differentiation-international-paper-group-3507953.html

Wikipedia, Opportunity cost (online) Available from: http://en.wikipedia.org/wiki/Opportunity_cost