Sorry, it was the name attribute not the id attribute. Why did you want 2
"David" <David@blackdeck.com> wrote in message
news:26AA9AD2-4DB8-4D25-9430-0B1D6CB3AA9E@microsoft.com...
> Thanks, Sam. But I must be missing something, because it still doesn't
work.
>
> Previously, my <channels> element was in the <application> element. So,
> when I added IDs, it informed me that I could only use the id attribute in
a
> channel template, which made sense. So, I created templates, and then the
> actual channel declarations used ref="" statements, and I got the same
> errors. I have tried a lot of variations on this theme, and get the same
> results. Here is my current configuration file:
>
>
> ////////////////////////////////
> <?xml version="1.0" encoding="utf-8" ?>
> <configuration>
> <system.runtime.remoting>
> <channels>
> <channel id="tcpchannel1" displayname="a"
> type="System.Runtime.Remoting.Channels.Tcp.TcpChannel,
> System.Runtime.Remoting, Version=1.0.5000.0, Culture=Neutral,
> PublicKeyToken=b77a5c561934e089" port="19543">
> <serverProviders>
> <formatter ref="binary" typeFilterLevel="Full"></formatter>
> </serverProviders>
> </channel>
> <channel id="tcpchannel2" displayname="b"
> type="System.Runtime.Remoting.Channels.Tcp.TcpChannel,
> System.Runtime.Remoting, Version=1.0.5000.0, Culture=Neutral,
> PublicKeyToken=b77a5c561934e089" port="19542">
> <serverProviders>
> <formatter ref="binary" typeFilterLevel="Full"/>
> </serverProviders>
> </channel>
> </channels>
>
>
> <application>
> <channels>
> <channel ref="tcpchannel1" port="19543"></channel>
> <channel ref="tcpchannel2" port="19542"></channel>
> </channels>
>
> </application>
> </system.runtime.remoting>
> </configuration>
>
> The result is always an exception that says "The channel tcp is already
> registered at
> System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel"
>
>
> I haven't seen any examples in the Microsoft literature where two
different
> tcp channels are registered at two different ports. Surely I can't be the
> only one trying to do this. Usually, when I am trying to do something
that I
> can't find anyone who has done something similar, I find that I have a
> fundamental misunderstanding of how things work. Is that what has
happened
> here?
>
> "Sam Santiago" wrote:
>
> > Add the id attribute for the channel element in your config file; here's
an
> > example:
> >
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/gnconchanneltemplate.asp
> >
> > Check out this link:
> >
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemRuntimeRemotingChannelsChannelServicesClassRegisterChannelTopic.asp?frame=true
> >
> > Here's an excerpt:
> > "Note You cannot register two channels with the same name in an
> > AppDomain. By default, the name of an HttpChannel is "http", and the
name of
> > a TcpChannel is "tcp". Therefore, if you want to register two channels
of
> > the same type, you must specify a different name for one of them through
> > configuration properties."
> >
> > Thanks,
> >
> > Sam
> > --
> > _______________________________
> > Sam Santiago
> > ssantiago@n0spam-SoftiTechture.com
> >
http://www.SoftiTechture.com > > _______________________________
> > "David" <David@blackdeck.com> wrote in message
> > news:6DB5D4CD-022C-4313-AFCA-AE783B497685@microsoft.com...
> > > I have created some remoting applications, and they work just fine,
and
> > all
> > > appeared well, until I decided to combine the functions from two
> > applications
> > > into a single service.
> > >
> > > So, what I have is two remotable objects. Both of them are hosted in
a
> > > single Windows service. I need a channel, then, for each of them. (I
do,
> > > don't I? Even if I don't absolutely have to do it that way, I would
rather
> > do
> > > it that way, because on the client side, the client code knows which
ports
> > to
> > > look for them on.)
> > >
> > > The myservice.exe.config file has a <channels> element that looks like
> > this.
> > >
> > > <channels>
> > > <channel displayname="tcpchannel1"
> > > type="System.Runtime.Remoting.Channels.Tcp.TcpChannel,
> > > System.Runtime.Remoting, Version= (etc)... port=19543"
> > > <ServerProviders> (etc) </serverProviders>
> > > </channel>
> > > <channel displayname="tcpchannel2"
> > > type="System.Runtime.Remoting.Channels.Tcp.TcpChannel,
> > > System.Runtime.Remoting, Version= (etc)... port=19542"
> > > <ServerProviders> (etc) </serverProviders>
> > > </channel>
> > > </channels>
> > >
> > > In other words, I want two TCP channels. One of them listens on
19542.
> > The
> > > other listens on 19543. These are the two ports I had used for each
of my
> > > previous applications, and the clients know to look for them.
> > >
> > > When I run, though, I get an error. "The channel tcp is already
> > registered".
> > >
> > > Can I only have one tcp channel for a service? I can't have two on
two
> > > different ports? How do I do that. I have tried several variations
on
> > the
> > > above, but nothing seems to work.
> > >
> > >
> >
> >
> >