private static void UnregisterObjectWellKnown(MarshalByRefObject obj)
 {
     if (obj != null)
     {
         log.Debug("UnregisterService: " + obj.ToString() + " " + RemotingServices.Disconnect(obj).ToString());
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Publishes the well known service instance.
        /// </summary>
        /// <param name="notifyName">Name of the notify.</param>
        /// <param name="interfaceType">Type of the interface.</param>
        /// <param name="instance">The instance.</param>
        /// <param name="mode">The mode.</param>
        public void PublishWellKnownServiceInstance(string notifyName, Type interfaceType, MarshalByRefObject instance, WellKnownObjectMode mode)
        {
            WriteLog("Instance URL --> " + BuildUrl(notifyName));
            RemotingConfiguration.RegisterWellKnownServiceType(interfaceType, BuildUrl(notifyName), mode);
            ObjRef objRef = RemotingServices.Marshal(instance, notifyName);

            WriteLog("(" + instance.ToString() + ") start listening at port: " + serverPort);
        }
        private static void RegisterObjectWellKnown(MarshalByRefObject obj, string servicename)
        {
            ObjRef objrefWellKnown = RemotingServices.Marshal(obj, servicename);

            log.Debug("RegisterService: " + obj.ToString() + " as " + servicename);
        }