Ken Kolda
10/18/2004 7:25:00 PM
What you have shown below will not get you where you want to be. When you
declare a <channel> with a non-zero port number in your config file, you're
creating a server channel. So, the remoting infrastructure will try to
attach a listener to this specified port to wait for remoting requests.
Since you already have your server processes running on that same machine
(using ports 10000 and 10001), you get the "port already in use" error.
In order to use different sinks for different channels, I'd recommend you
write this login into your client channel sink provider. In your provider
you could inspect the Uri of the remote system, check for a specific
property on the underlying channel object or use the channelData to indicate
whether you should include your custom sink or not. The provider would then
either hook in the sink or omit it and simply generate the rest of the sink
chain.
Hope that helps -
Ken
"labreaks" <labreaks@aol.com> wrote in message
news:d314fd5a.0410181034.5641ba82@posting.google.com...
> Hi Guys,
>
> I've been stuck on this one for quite some time now. Any help would
> be greatly appreciated. I want to configure my client application to
> remote certain objects on
> two different servers. I want the objects created on server 1 to pass
> through a client side sink, and I do not want the objects on server 2
> to pass through the client sink.
>
> When using the configuration file below, i get the following
> exception: System.Net.Sockets.SocketException: Only one usage of each
> socket address (protocol/network address/port) is normally permitted.
>
> How do I set up my configuration file to use the custom sink on only
> certain objects?
>
> <configuration>
> <system.runtime.remoting>
> <application>
> <client>
> <wellknown type="whatever.UseSink_Object, whatever"
> url="tcp://localhost:10000/SomeObject1.rem" />
> <wellknown type="whatever.NoUseSink_Object, whatever"
> url="tcp://localhost:10001/SomeObject2.rem" />
> </client>
> <channels>
> <channel ref="tcp" port="10000" name="Server 1">
> <clientProviders>
> <formatter type="RemotingHelper.AbstractClientFormatterSinkProvider,
> RemotingHelper"/>
> </clientProviders>
> <serverProviders>
> <formatter ref="binary"/>
> </serverProviders>
> </channel>
>
> <channel ref="tcp" port="10001" name="Server 2">
> </channel>
> </channels>
>
> </application>
> </system.runtime.remoting>
> </configuration>