IClientMessageInspector and OneWay Operations

Link. December 18, 2006. Comments [0]. Posted in: QuickCounters | WCF | WinFX

A while ago I talked a bit about Windows Communication Foundation's IParameterInspector extensibility and how it was affected by One-Way operations on the server and client side. Just so you're aware, the IClientMessageInspector has the same issues as IParameterInspector on the client side; that is, the AfterReceiveReply() method will never be called for OneWay methods.

I'm working currently on implementing client-side proxy instrumentation in WCF for QuickCounters, and to work around this limitation, here's what I'm currently doing:

  1. While constructing my IClientMessageInspector implementation, I build a map of operations from the endpoint ContractDescription (which I get from the IEndpointBehavior implementation). Here I take note of which operations are OneWay.
  2. When BeforeSendRequest() is called, I check the operations map, and if it is a message for a OneWay operation, then I immediate free the necessary resources, to avoid leaking them because AfterReceiveReply() won't be called.

This does imply that instrumentation for one-way operations on the client side will be a little weaker (certainly more so than for the server side), but it will stll be useful and reduced functionality was expected anyway because the client side has no way to detect faults, for example.



Comments are closed.

Syndicate

About

Tomas Restrepo is a software developer located in Colombia, South America. His interests include .NET, Connected Systems, PowerShell and lately dynamic programming languages. More...

tomasrestrepo @ twitter My Flickr photostream My saved links on delicious My Technorati Profile

email: tomas@winterdom.com
msn: tomasr@passport.com

View my profile on LinkedIn

MVP logo

Ads


Categories

Statistics

Total Posts: 1035
This Year: 105
This Month: 4
This Week: 2
Comments: 802

Archive

Other

Copyright © 2002-2008, Tomas Restrepo.

Powered by: newtelligence dasBlog 2.1.8139.823

Sign In