-
.NET Remoting: Cannot connect 2nd Client to server when first client is already logge
Hi All,
I am building a collaborative application, where two or more clients can logIn to a (remoting) server. My application runs fine, when both the client machines and the server; all three are in same network. But If the client machine are running/accesing the server from a network differnet from where the server is; Only the first client login is sucessfull, and after that second client login fails.
Error I get on second client machine trying to login to ther sever:
Could not connect to server:<server Ip Address here>
System.Runtime.Remoting.RemotingException:Server encountered an internal error. For more information, turn off customErrors in the server's .config file.
Server stack trace:
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg,
IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&msgData,Int32 type)
at MyRemotableClasses.MyRemotableObject.RemoteFunction()
at ClientApp.CallRemoteFunction();
_________________________________________________________________________
Code on server which makes remoting channels:
*********************************************
string name = NAME +".channel" + cid.ToString();
int port = PORT + cid;
IDictionary props = new Hashtable();
props["name"] = name;
props["priority"] = "100";
props["port"] = port;
BinaryServerFormatterSinkProvider provider = new BinaryServerFormatterSinkProvider();
provider.TypeFilterLevel = TypeFilterLevel.Full;
TcpChannel channel = new TcpChannel(props, null, provider);
ChannelServices.RegisterChannel(channel, false);
WellKnownServiceTypeEntry wkste = new WellKnownServiceTypeEntry(typeof(RemoteClasses.Server), name, WellKnownObjectMode.Singleton);
RemotingConfiguration.RegisterWellKnownServiceType(wkste);
--------------------------------------------
Client-Side:
*******************
BinaryClientFormatterSinkProvider clientProvider = new BinaryClientFormatterSinkProvider();
BinaryServerFormatterSinkProvider serverProvider = new BinaryServerFormatterSinkProvider();
serverProvider.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;
IDictionary props = new Hashtable();
props["port"] = 0;
clientChannel = new TcpChannel(props, clientProvider, serverProvider);
ChannelServices.RegisterChannel(clientChannel, false);
RemotingConfiguration.RegisterWellKnownServiceType(typeof(RemoteClasses.Server), "Server", WellKnownObjectMode.Singleton);
server = (RemoteClasses.Server)Activator.GetObject(typeof(RemoteClasses.Server), @"tcp://" + serverip + ":" + port + "/" + servername + ".channel" + channel);
___________________________________________________
Need some troubleshooting tips; as to why the second client fails to login...incase when clients are in a differnt network than that of server (hosting the remotable object).
thanks in advance!
Rupinder
Similar Threads
-
By rperez in forum Database
Replies: 5
Last Post: 01-02-2009, 04:14 PM
-
By balu1234 in forum .NET
Replies: 1
Last Post: 11-20-2008, 07:45 AM
-
By imranx101 in forum .NET
Replies: 10
Last Post: 06-13-2008, 11:32 AM
-
By Calderara Serge in forum Enterprise
Replies: 1
Last Post: 07-24-2002, 12:40 AM
-
Replies: 7
Last Post: 09-15-2000, 08:44 AM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks