/*public*/ void IStateClientManager.ConfigInit(SessionStateSectionHandler.Config config, SessionOnEndTarget onEndTarget) { int hr; try { /* * stateConnection string has the following format: * * "tcpip=<server>:<port>" */ string [] parts = config._stateConnectionString.Split(new char[] { '=' }); if (parts.Length != 2 || parts[0] != "tcpip") { throw new ArgumentException(); } parts = parts[1].Split(new char[] { ':' }); if (parts.Length != 2) { throw new ArgumentException(); } s_server = parts[0]; s_port = (int)System.UInt16.Parse(parts[1]); s_networkTimeout = config._stateNetworkTimeout; // At v1, we won't accept server name that has non-ascii characters foreach (char c in s_server) { if (c > 0x7F) { throw new ArgumentException(); } } } catch { throw new ConfigurationException( HttpRuntime.FormatResourceString(SR.Invalid_value_for_sessionstate_stateConnectionString, config._stateConnectionString), config._configFileName, config._stateLine); } string appId = HttpRuntime.AppDomainAppIdInternal; string idHash = MachineKey.HashAndBase64EncodeString(appId); s_uribase = "/" + appId + "(" + idHash + ")/"; s_rpool = new ResourcePool(new TimeSpan(0, 0, 5), int.MaxValue); hr = UnsafeNativeMethods.SessionNDConnectToService(s_server); if (hr != 0) { throw new HttpException(HttpRuntime.FormatResourceString(SR.Cant_connect_to_session_service), hr); } }