Home SmartChannels Advanced scenarios: callbacks and authorization.

Login Form



Advanced scenarios: callbacks and authorization. PDF Print E-mail
Article Index
Advanced scenarios: callbacks and authorization.
Callback interface definition.
Service interface definition.
Service implemetation.
Defining service configuration.
Client implementation.
Defining client configuration.
Enabling authorization.

 

 

Well, we got through step by step HOWTO in this article and developed simple client-server application.

Now it is time to move further and highlight callbacks and simple authorization support.


Before we start, there is one important note: using callbacks from a server to clients requires your clients to be reachable from a server. If your clients or a server are behind firewall that prevents direct communication then an architecture with callbacks is not your choice.

Well, after we mentioned this important note, we may start to think where we may need to use callbacks. In event-driven programming, there is often use, in different forms, of the Observer pattern, which essentially allows the use of multi-cast callbacks, and where callbacks are registered early, to be invoked at callee's discretion (i.e. when a given event occurs).

Let's consider the task, when you have a service that performs some job and have an ability to notify the callers about the progress of the execution. Clients call the service function and wait until it returns, but in the background they receive messages about the execution progress. To be more specific and clear let's create a client-server application using callbacks with .NET Remoting and SmartChannels library. The server will accept calls from the clients with callback information, perform some job and inform clients about the progress during execution. Clients will place a call and supply callback information. When they will receive callback call, they will output information about the progress for the user.

For simplicity let's make the server and client applications of Console type applications.

 



 

Copyright © 2010 SmartSoftwareBits.com. All Rights Reserved.