Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3433184
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T07:32:34+00:00 2026-05-18T07:32:34+00:00

For a project we’re working on, we’re using .NET remoting to communicate between the

  • 0

For a project we’re working on, we’re using .NET remoting to communicate between the server and client. So far we’ve been testing it on the same machine and its worked, using localhost and an arbitrary port number. However, when testing between two machines on the same network, using, the main component works, but a proxy object fails.

We’re using configuration files to set the server name and port, like this:

<setting name="ServerName" serializeAs="String">
    <value>192.168.1.141</value>
</setting>
<setting name="Port" serializeAs="String">
    <value>9932</value>
</setting>

The client sets up the remoting object as follows:

_port = global::ConsoleClient.Properties.Settings.Default.Port;
_servername = global::ConsoleClient.Properties.Settings.Default.ServerName;

string url = "tcp://" + _servername + ":" + _port + "/Lobby";

try
{
    ChannelServices.RegisterChannel(new TcpClientChannel(), false);
    Lobby lobby = (Lobby)Activator.GetObject(
        typeof(Lobby), url);
}
catch (Exception e)
{
}

This works fine and we are able to call methods on the lobby object. However, later on in the code, we return another object, table as follows:

table_proxy = lobby_proxy.joinTable(userID, i);

where lobby_proxy is the same lobby object in the prior code. The server is configured in the following manner:

_port = global::Server.Properties.Settings.Default.Port;
_lobby = new Lobby(_db);

try
{
    TcpServerChannel channel = new TcpServerChannel(_port);
    ChannelServices.RegisterChannel(channel, false);
    RemotingConfiguration.RegisterWellKnownServiceType(typeof(Lobby),
            "Lobby", WellKnownObjectMode.Singleton);
    RemotingServices.Marshal((_lobby), "Lobby");
    System.Console.WriteLine("Press Any Key");
}
catch (Exception e)
{
    System.Console.WriteLine(e);
}

This works fine when run on the same machine, but throws the following error when run on separate machines:

System.Net.Sockets.SocketException (0x80004005): A socket operation was attempte
d to an unreachable network 169.254.171.86:9932
   Exit
Server stack trace:
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddre
ss 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.RemoteConnection.GetSocket()
   at System.Runtime.Remoting.Channels.SocketCache.GetSocket(String machinePortA
ndSid, Boolean openNew)
   at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.SendRequestWit
hRetry(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream)
   at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage
(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITranspor
tHeaders& responseHeaders, Stream& responseStream)
   at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMess
age(IMessage msg)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage req
Msg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgDa
ta, Int32 type)
   at JackOfTrades.Common.Table.GetTableData(Boolean full)

Looking at the top, there is an IP address that I do not recognize, it’s neither on the network nor the IP of the router.

Any thoughts on whats wrong? Help would be greatly appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T07:32:34+00:00Added an answer on May 18, 2026 at 7:32 am

    You need to setup TcpServerChannel with following parameter:

    bindTo
    A string that specifies the IP address of the network interface card (NIC) to which the server channel should bind. The default value is System.Net.IPAddress.Any.

    http://msdn.microsoft.com/en-us/library/bb397831.aspx

    UPDATED:

    IDictionary properties = new Hashtable();
    properties["port"] = 9932;
    properties["bindTo"] = "192.168.1.141";
    TcpServerChannel channel = new TcpServerChannel(properties, null);
    ChannelServices.RegisterChannel(channel,  false);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My project has both client and server components in the same solution file. I
I project I have been working on has now been split between me and
The project is ASP.NET 2.0, I have never been able to reproduce this myself,
The project I'm working is using n-tier architecture. Our layers are as follows: Data
A project I have been working on for the past year writes out log
A project I'm working on at the moment involves refactoring a C# Com Object
My project is currently using a svn repository which gains several hundred new revisions
The project I'm working on allows an end-user to modify CSS code to integrate
Project Darkstar was the topic of the monthly JavaSIG meeting down at the Google
Every project invariably needs some type of reporting functionality. From a foreach loop in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.