On Tue, Aug 11, 2009 at 8:04 PM, John Simons <[email protected]>wrote:

>
> Craig,
>
> So, you are saying that the ChannelFactory is reused but the Channel
> is not.


Basically yes.  If a channel is faulted it is automatically refreshed.

>
> Also, you are saying that if I call container.Release(proxy); the
> channel will be disposed.
> I don't see this happening, I'm using the trunk version and have put
> break points on your code pretty much everywhere I could find either
> Close() or Dispose(), and I can only see the channels being disposed
> when the I dispose of the windsor container.


So are you trying to verify the channels are closing or the ChannelFactory?
I tested that against the unit tests and it seems to perform as expected

>
>
> Do I need to do this myself:
> ((IClientChannel)proxy).Close();
> before calling container.Release(proxy);   ?


Nope

>
>
> Cheers
> John
>
> On Aug 11, 10:23 pm, Craig Neuwirt <[email protected]> wrote:
> > John,
> >   The ChannelFactory create multiple channels and thus will not be closed
> > when you release the proxy.  The actual Channel will be closed however.
> >  Then the component is released or the container is disposed of, the
> > ChannelFactory will get closed.
> >
> > craig
> >
> > On Sun, Aug 9, 2009 at 11:52 PM, John Simons <[email protected]
> >wrote:
>  >
> >
> >
> > > Not sure if I'm using this facility correctly.
> >
> > > I'm using it on the client side.
> >
> > > I have configured my services to be LifeStyle.Transient because my
> > > endpoint url changes dynamically.
> >
> > > Here is a snip of my global.asax:
> >
> > >        container = new WindsorContainer()
> > >                        .AddFacility("startable", new
> StartableFacility())
> > >                        .AddFacility("mr", new MonoRailFacility())
> > >                        .AddFacility("loggingfacility", new
> LoggingFacility
> > > (LoggerImplementation.Log4net, "Config/logging.config"))
> > >                        .AddFacility<WcfFacility>(f => f.DefaultBinding
> =
> > >                                                       new WSHttpBinding
> > >                                                           {
> >
> > > BypassProxyOnLocal =
> > > true,
> >
> > > MaxReceivedMessageSize = 331070,
> >
> > > UseDefaultWebProxy =
> > > false,
> >
> > >                                                           }
> > >                        )
> > >                        .Register(
> > >
>  Component.For<ChannelFactoryListener>(),
> > >                                  Component.For<ICore>()
> > >                                      .LifeStyle.Transient
> > >                                      .ActAs(new DefaultClientModel()),
> > >                                  Component.For<IComputerManagement>()
> > >                                      .LifeStyle.Transient
> > >                                      .ActAs(new DefaultClientModel()),
> > >                                  Component.For<IUserManagement>()
> > >                                      .LifeStyle.Transient
> > >                                      .ActAs(new DefaultClientModel()),
> > >                                  Component.For<IPostManagement>()
> > >                                      .LifeStyle.Transient
> > >                                      .ActAs(new DefaultClientModel()));
> >
> > > I than use it like this:
> > > proxy = container.Resolve<ICore>(new { Endpoint = WcfEndpoint.At
> > > (uri) });
> >
> > > and once I'm done with it I call:
> > > container.Release(proxy);
> >
> > > I assumed that by calling "container.Release(proxy);" on a Transient
> > > component the ChannelFactory.Close() would be called, but this doesn't
> > > seem to be the case. Am I doing something wrong?
> > > I need the ChannelFactory to be disposed of otherwise all the Channels
> > > remain open!
> >
> > > BTW, the ChannelFactoryListener is just this:
> > > public class ChannelFactoryListener : AbstractChannelFactoryAware
> > > {
> > >        public override void Created(ChannelFactory channelFactory)
> > >        {
> > >            channelFactory.Credentials.Windows.ClientCredential =
> > > CredentialCache.DefaultNetworkCredentials;
> >
> > > channelFactory.Credentials.Windows.AllowedImpersonationLevel =
> > > TokenImpersonationLevel.Impersonation;
> > >        }
> > > }
> >
> > > Cheers
> > > John
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to