CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2008
    Posts
    2

    .Net Remoting Exception

    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(Remote.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.GetSocket(String machinePortAndSid, Boolean openNew)
    at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.SendRequestWithRetry(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream)
    at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
    at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)

    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 Remote.cls_SMSList.CreateSMSList(List`1 ComPort)
    at cls_QueueList.LoadMobiles()


    Any help Would be appriciated.

  2. #2
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: .Net Remoting Exception

    [ Moved 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
  •  





Click Here to Expand Forum to Full Width

Featured