Сервер:
Host h = new Host();
h.Name = "JARR!!";
TcpChannel channel = new TcpChannel(8080);
ChannelServices.RegisterChannel(channel);
RemotingConfiguration.RegisterWellKnownServiceType(typeof(Host), "Server",
WellKnownObjectMode.Singleton);
Клиент:
TcpChannel chan = new TcpChannel();
ChannelServices.RegisterChannel(chan);
remoteHost = (Host)Activator.GetObject(typeof(Host),
"tcp://127.0.0.1:8080/Server");
Класс:
[Serializable]
public class Host: MarshalByRefObject
{
public string Name{get; set;}
public Host(){}
public Host(string n)
{
Name = n;
}
public override string ToString()
{
return Name;
}
}
Соединение в норме, порт 8080 открыт, на стороне клиента remoteHost не нулевой, а remoteHost.Name == ""
Почему?