.NET
  Home arrow .NET arrow Page 2 - Introduction to RPC on Windows, Part II
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
.NET

Introduction to RPC on Windows, Part II
By: Digvijay Chauhan
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 9
    2005-01-17

    Table of Contents:
  • Introduction to RPC on Windows, Part II
  • Types of Handles
  • Types of Binding Handles
  • Implicit binding handles
  • Explicit binding handles

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Introduction to RPC on Windows, Part II - Types of Handles


    (Page 2 of 5 )

    There are two types of handles that we use while we program using RPC: Binding handles and Context handles. As an extension to the Standard RPC, Microsoft also provides a third type of handle: the serialization handle. These are used to encode or decode data. Just remember that these are used for serialization on a local computer only and do not involve any remote bindings. Here, we’re going to discuss the Binding and Context handles only and look at their usage.

    Binding Handles

    Binding handles come into the picture when we try to establish a logical connection between a client program and a server program. In fact the information that is needed to create a binding between a client and server is represented by a structure called a binding handle. Thus the binding handle is analogous to any other handle in the Win32 world: it just hides the binding information from the programmer and allows the RPC runtime to use it in an orderly fashion. The programmer is allowed to use and manipulate this information through a set of APIs that RPC runtime provides in the Windowing API that allows us to change the behavior or appearance of a window, if we have its handle. This way the run-time libraries access and manipulate the data appropriately on the programmer’s invocation.

    Context Handles

    Context handles, on the other hand, are needed to maintain a state between a client and a server. Consider the case of an Internet session where a user visits a publishing company’s Web page and orders a few books. Next he chooses to pay online and in this process he reaches a page to input his credit card information. At this point is the information about books to be purchased lost? No, certainly not. Then how is this information moved from page to page? The browser maintains a session with the Web server and sends the state information to the Web server with each request to maintain the session, regardless of whether that information is about a book's title or the credit card details. In the case of RPC, context handles manage the state in a similar fashion. The state information is usually termed server’s context, which clients can use to identify a server for their individual RPC sessions.

    It’s important to note that the context handle always represents information relevant to the sever side of the communication, but the client can always use it to pass some information to the server. Let’s say a server manages a number of files at the request of several clients. In this case, the server may use the file handle (which is unique on the server side) as the context handle. When a client sends a request, it also needs to send a context handle to tell the server which file to operate on -- which is, in fact, a valid file handle on the server side. In essence the client does not actually get the file handle itself; it gets an opaque token that the server RPC run time can uniquely associate with the file handle. Mostly, a context handle points to a block of memory on the server where the server keeps any management information.

    More .NET Articles
    More By Digvijay Chauhan


       · Hi I'm Digvijay ....... the author of this article.Please feel free to ask any...
       · I do like your explaination on the topic of RPC. I try to used them to solve...
       · Thank you for your article. I am having a problem where the sever denies access to...
       · Hi,I didn't get what you're trying to solve. Could you please give me the...
       · What is the exact error do you get?Would you like me to take a look at the...
     

    .NET ARTICLES

    - Using CrystalReportViewer to Display Crystal...
    - Creating Summary .Net Crystal Reports
    - More on Commands, Input and the WPF
    - Grouping and Aggregating When Querying LINQ ...
    - Commands, Input and the WPF
    - Keyboard and Ink Input with WPF
    - Mouse Input and the WPF
    - Input with Windows Presentation Foundation
    - Introducing LINQ with XML and Databases
    - An Introduction to LINQ
    - Querying LINQ to SQL: Basics
    - Completing a Simple Storefront with LINQ
    - Knowing Your Environment: the System.Environ...
    - Creating the Home Page for a Simple Storefro...
    - LINQ Quickly with Language Integrated Queries

     
    Best Practices for Windows Vista Migration Presentation
    Dell and Microsoft recently held a series of face-to-face seminars entitled, &qu....

     
    Creating a Culture for Code Reuse
    If you oversee development teams you know that like it or not proprietary and ex....

     
    Keys to Web Application Acceleration: Advances in Delivery Systems
    Accelerate Web apps by up to 5x. Ensure significantly faster access to the Web a....

     
    Optimizing Application Monitoring
    Tired of finding out from your customers that you're offline? This white paper e....

     
    Solaris to Solaris Migration -- Migrating applications from Sun SPARC to Dell PowerEdge R900
    This comprehensive Migration Guide reviews the approach that Principled Technolo....

     




    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
    Stay green...Green IT