// Initialise the remoting connection with http channel with binary formatter public bool RemotingConnection() { if (!_exist) { HttpChannel channel = null; try { IDictionary props = new Hashtable(); props["port"] = TechnicalSettings.RemotingServerPort; props.Add("typeFilterLevel", TypeFilterLevel.Full); //props.Add("timeout", 2000); BinaryClientFormatterSinkProvider clientProvider = new BinaryClientFormatterSinkProvider(); channel = new HttpChannel(props, clientProvider, null); ChannelServices.RegisterChannel(channel, false); //TcpChannel channel = new TcpChannel(); //ChannelServices.RegisterChannel(channel, true); var server = string.Format("http://{0}:{1}/RemoteOperation", TechnicalSettings.RemotingServer, TechnicalSettings.RemotingServerPort); _remoteOperation = (IRemoteOperation)Activator.GetObject(typeof(IRemoteOperation), server); _exist = _remoteOperation.TestRemoting(); //ChannelServices.GetChannelSinkProperties(_remoteOperation)["timeout"] = 0; } catch (Exception e) { _remotingUniqueInstance = null; ChannelServices.UnregisterChannel(channel); throw; } } return(true); }
public static Remoting GetInstance() { if (_remotingUniqueInstance == null) { return(_remotingUniqueInstance = new Remoting()); } else { return(_remotingUniqueInstance); } }
private ServicesProvider() { if (TechnicalSettings.UseOnlineMode) { _iServices = Remoting.GetInstance(); } else { _iServices = new Standard(); } }
// Initialise the remoting connection with http channel with binary formatter public bool RemotingConnection() { if (!_exist) { HttpChannel channel = null; try { IDictionary props = new Hashtable(); props["port"] = TechnicalSettings.RemotingServerPort; props.Add("typeFilterLevel", TypeFilterLevel.Full); //props.Add("timeout", 2000); BinaryClientFormatterSinkProvider clientProvider = new BinaryClientFormatterSinkProvider(); channel = new HttpChannel(props, clientProvider, null); ChannelServices.RegisterChannel(channel, false); //TcpChannel channel = new TcpChannel(); //ChannelServices.RegisterChannel(channel, true); var server = string.Format("http://{0}:{1}/RemoteOperation", TechnicalSettings.RemotingServer, TechnicalSettings.RemotingServerPort); _remoteOperation = (IRemoteOperation) Activator.GetObject(typeof (IRemoteOperation), server); _exist = _remoteOperation.TestRemoting(); //ChannelServices.GetChannelSinkProperties(_remoteOperation)["timeout"] = 0; } catch(Exception e) { _remotingUniqueInstance = null; ChannelServices.UnregisterChannel(channel); throw; } } return true; }
public static Remoting GetInstance() { if (_remotingUniqueInstance == null) return _remotingUniqueInstance = new Remoting(); else return _remotingUniqueInstance; }