On May 19, 11:53 am, Kevin J. Stricklin
[quoted text, click to view] <KevinJStrick...@discussions.microsoft.com> wrote:
> The problem due to the way the security negotiation works. If you don't add
> the channel element to your config file, Remoting defaults to an unsecure
> connection. When two Remoting processes attempt to establish a connection
> where one is secure and the other isn't, they "hang". Once side is waiting
> for more security information and the other side is waiting for more Remoting
> data.
I am encountering a very similar problem. I have a secure TCP channel
here, and I have the client and the server running on the same box to
rule out any domain/trust issues. The first time I try to use the
remote object, it hangs. Does anyone have any idea how I can debug
this to find out what is wrong?
In case it matters, here is the server code (not using the config
files like earlier in this thread):
BinaryServerFormatterSinkProvider provider = new
BinaryServerFormatterSinkProvider();
provider.TypeFilterLevel =
System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;
Hashtable channelProperties = new Hashtable();
channelProperties.Add("port", 9765); // define the port
channelProperties.Add("secure", true);
channelProperties.Add("impersonate", true);
channelProperties.Add("name", "myname1");
ChannelServices.RegisterChannel(new TcpChannel(channelProperties,
null, provider), false);
WellKnownServiceTypeEntry entry = new
WellKnownServiceTypeEntry(typeof(MyService), "MyService.rem",
WellKnownObjectMode.SingleCall);
RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.Off;
RemotingConfiguration.RegisterWellKnownServiceType(entry);
Client code:
Hashtable channelProperties = new Hashtable();
channelProperties.Add("secure", true);
channelProperties.Add("tokenImpersonationLevel", "Impersonation");
channelProperties.Add("connectionTimeout", 5000);
channelProperties.Add("name", "myname1");
TcpClientChannel clientChannel = new
TcpClientChannel(channelProperties, null);
ChannelServices.RegisterChannel(clientChannel, false);
RemotingConfiguration.RegisterWellKnownClientType(typeof(IMyService),
"tcp://localhost:9765/MyService.rem");
IMyService myService =
(ICardCommand)Activator.GetObject(typeof(IMyService), cardCommandUri);
myService.GetData(...) // this hangs; works when everything is