Hi EveryBody,
I am developing .net remoting application.I have Created server and client application. Server has installed on Two Pc's and cliient have to connect two Pc's and do some functions.
Its working Fine on local machine . But when i tried to connect two PC's, its through an remoting exception
This is my server code:
Dictionary<string, object> props = new Dictionary<string, object>();
props["typeFilterLevel"] = "Full";
BinaryServerFormatterSinkProvider provider = new BinaryServerFormatterSinkProvider(props, null);
props["secure"] = true;
props["port"] = 60800;
TcpChannel tcpchan = new TcpChannel(props, null, provider);
ChannelServices.RegisterChannel(tcpchan, true);
RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.Off;
//TcpChannel remoteChannel = new TcpChannel(60800);
//ChannelServices.RegisterChannel(remoteChannel,true );
RemotingConfiguration.RegisterWellKnownServiceType (typeof(Remote.cls_SMSList), "cls_SMSList", WellKnownObjectMode.Singleton);
This is my Client Code:
Dictionary<string, object> props = new Dictionary<string, object>();
props["secure"] = true;
props["domain"] = dsPcDetails.Tables[0].Rows[0]["Dname"].ToString();
props["username"] = dsPcDetails.Tables[0].Rows[0]["Username"].ToString();
props["password"] = dsPcDetails.Tables[0].Rows[0]["Password"].ToString();
props["port"] = 0;
Channel = new TcpChannel(props, null, null);
ChannelServices.RegisterChannel(Channel, true);
PcnameList.Add(dsPcDetails.Tables[0].Rows[0]["PCName"].ToString());
ObjSMS = (Remote.cls_SMSList)Activator.GetObject(typeof(Rem ote.cls_SMSList), "tcp://" + IPadd + "/cls_SMSList");
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
Server stack trace:
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at System.Runtime.Remoting.Channels.RemoteConnection. CreateNewSocket(EndPoint ipEndPoint)
at System.Runtime.Remoting.Channels.RemoteConnection. CreateNewSocket()
at System.Runtime.Remoting.Channels.SocketCache.GetSo cket(String machinePortAndSid, Boolean openNew)
at System.Runtime.Remoting.Channels.Tcp.TcpClientTran sportSink.SendRequestWithRetry(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream)
at System.Runtime.Remoting.Channels.Tcp.TcpClientTran sportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
at System.Runtime.Remoting.Channels.BinaryClientForma tterSink.SyncProcessMessage(IMessage msg)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData& msgData, Int32 type)
at Remote.cls_SMSList.CreateSMSList(List`1 ComPort)
at cls_QueueList.LoadMobiles()
Any help Would be appriciated.