Jak powiedzieli inni, jeśli nie określisz nazwy kanału, kod domyślnie używa "tcp", a każdy kanał musi mieć unikalną nazwę: więc podaj unikalną nazwę dla każdego otwieranego kanału ...
int tcpPort = 52131;
// ------------------------------------------------------------
BinaryServerFormatterSinkProvider serverProv =
new BinaryServerFormatterSinkProvider();
serverProv.TypeFilterLevel = TypeFilterLevel.Full;
RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.Off;
serverProv.TypeFilterLevel = TypeFilterLevel.Full;
IDictionary propBag = new Hashtable();
// -----------------------------------------
bool isSecure = [true/false];
propBag["port"] = tcpPort ;
propBag["typeFilterLevel"] = TypeFilterLevel.Full;
propBag["name"] = "UniqueChannelName"; // here enter unique channel name
if (isSecure) // if you want remoting comm to be secure and encrypted
{
propBag["secure"] = isSecure;
propBag["impersonate"] = false; // change to true to do impersonation
}
// -----------------------------------------
tcpChan = new TcpChannel(
propBag, null, serverProv);
ChannelServices.RegisterChannel(tcpChan, isSecure);
// --------------------------------------------
string uRI = MyUniversalResourceIndicatorName;
// ---------------------------------------------
RemotingConfiguration.RegisterWellKnownServiceType(
typeof(ImportServiceManager), uRI ,
WellKnownObjectMode.SingleCall);
Porty są di fferent .. –
@ Khurram Aziz - Więc każda instancja otwiera różne porty (zamiast każdej instancji otwiera wiele portów, ale używa różnych)? – stevehipwell
@ Khurram Aziz - Czy masz oba kanały używające różnych nazw? – stevehipwell