public void Close() { if (_connection != null) { if (_fetcher != null) { _fetcher.Dispose(); _fetcher = null; } _serverConnection = null; _connection.Close(); _connection = null; } }
private RemotingConnector(SerializationInfo info, StreamingContext context) { string connectionId = info.GetString("connectionId"); _serviceUrl = new Uri(info.GetString("serviceUrl")); string typeString = info.GetString("tokenType"); if (typeString != null) { Type tokenType = Type.GetType(typeString, true); _token = info.GetValue("token", tokenType); } _fetcherConfig = (NotificationFetcherConfig) info.GetValue("fetcherConfig", typeof(NotificationFetcherConfig)); if (connectionId != null) { IRemotingServer server = (IRemotingServer)Activator.GetObject(typeof(IRemotingServer), _serviceUrl.ToString()); _connection = server.Reconnect(connectionId); _serverConnection = new RemotingMBeanServerConnection(_connection, _token); _fetcher = new NotificationFetcher(_fetcherConfig, _connection, _serverConnection); } }
public void Connect(object credentials) { object token; IRemotingServer server = (IRemotingServer)Activator.GetObject(typeof(IRemotingServer), _serviceUrl.ToString()); _connection = server.NewClient(credentials, out token); _token = token; _serverConnection = new RemotingMBeanServerConnection(_connection, _token); _fetcher = new NotificationFetcher(_fetcherConfig, _connection, _serverConnection); }