Viper
Member
Hi
I've got a couple .NET remoting applications here. One that I'm busy developing and some samples that I've downloaded from the internet.
When registering the TCP channel on the client, I have two scenarios.
1. I just register the TCP channel without any special parameters. This works fine.
2. I supply a Username, Password and Domain when registering the channel. If I do this, the program freezes when calling a method on the remote object. I left it for a couple of minutes and it didn't timeout or throw an exception or anything.
Both these cases apply on my local computer and when deployed to a different computer. However, scenario 1 only works on the remote computer if there is a user account on the server with the exact same Windows username and password as logged in with on the client computer.
Here is the code used:
Code that works:
Code that freezes
After that, the code looks something like this:
I want to use TCP Binary remoting because it is the fastest and we don't need to communicate with other applications or anything funny. I must however be able to supply a different username, password and domain when connecting to the server as some of our customers have different domains or sometimes no domain at all.
I found a way to do this by using WCF, but I don't think it would be practical in my case since a lot of our customers still have server and client computers running on Windows 2000 & XP SP1.
Any suggestions?
I've got a couple .NET remoting applications here. One that I'm busy developing and some samples that I've downloaded from the internet.
When registering the TCP channel on the client, I have two scenarios.
1. I just register the TCP channel without any special parameters. This works fine.
2. I supply a Username, Password and Domain when registering the channel. If I do this, the program freezes when calling a method on the remote object. I left it for a couple of minutes and it didn't timeout or throw an exception or anything.
Both these cases apply on my local computer and when deployed to a different computer. However, scenario 1 only works on the remote computer if there is a user account on the server with the exact same Windows username and password as logged in with on the client computer.
Here is the code used:
Code that works:
VB.NET:
TChannel = New Channels.Tcp.TcpChannel()
Channels.ChannelServices.RegisterChannel(TChannel, True)
Code that freezes
VB.NET:
Dim props As New Dictionary(Of String, Object)
props("secure") = True
props("domain") = My.Settings.ServerDomain
props("username") = My.Settings.ServerUsername
props("password") = My.Settings.ServerPassword
props("port") = 0
Dim tcp As New Channels.Tcp.TcpChannel(props, Nothing, Nothing)
Channels.ChannelServices.RegisterChannel(TChannel, True)
After that, the code looks something like this:
VB.NET:
ServerUrl = My.Settings.Protocol & "://" & My.Settings.Server & ":" & My.Settings.Port.ToString.Trim
RemotingConfiguration.RegisterWellKnownServiceType( _
GetType(ServerInterfaces.IEmployeeManagement), _
ServerUrl & "/EmployeeManagement.rem", _
WellKnownObjectMode.SingleCall)
Dim EM As IEmployeeManagement = _
Activator.GetObject(GetType(ServerInterfaces.IEmployeeManagement), ServerUrl & "/EmployeeManagement.rem")
Dim Emp As Employee = EM.GetEmployee(1)
I want to use TCP Binary remoting because it is the fastest and we don't need to communicate with other applications or anything funny. I must however be able to supply a different username, password and domain when connecting to the server as some of our customers have different domains or sometimes no domain at all.
I found a way to do this by using WCF, but I don't think it would be practical in my case since a lot of our customers still have server and client computers running on Windows 2000 & XP SP1.
Any suggestions?