Skip to content
This repository
Browse code

Fixes #10 where the webclient stopped reading from the socket after a…

… while (5 mins or so).

- Changed the client's ReadWriteTimeout property to infinite.
- Change dthe NorthScale defaults to us ethe proxy port instead of the direct one.
  • Loading branch information...
commit f265b92d00087df795bf5f42f099288232289750 1 parent f05c23a
Attila Kiskó authored
2  Enyim.Caching/Configuration/EndPointElementCollection.cs
@@ -36,7 +36,7 @@ protected override object GetElementKey(ConfigurationElement element)
36 36 /// Helper method; converts the collection into an <see cref="T:IPEndPoint"/> collection for the interface implementation.
37 37 /// </summary>
38 38 /// <returns></returns>
39   - internal IList<IPEndPoint> ToIPEndPointCollection()
  39 + public IList<IPEndPoint> ToIPEndPointCollection()
40 40 {
41 41 List<IPEndPoint> retval = new List<IPEndPoint>(this.Count);
42 42 foreach (EndPointElement e in this)
334 Enyim.Caching/Enyim.Caching.csproj
... ... @@ -1,166 +1,170 @@
1   -<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2   - <PropertyGroup>
3   - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4   - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5   - <ProductVersion>9.0.30729</ProductVersion>
6   - <SchemaVersion>2.0</SchemaVersion>
7   - <ProjectGuid>{D438C0B3-A168-40B8-BDDD-61F0939DFF35}</ProjectGuid>
8   - <OutputType>Library</OutputType>
9   - <AppDesignerFolder>Properties</AppDesignerFolder>
10   - <RootNamespace>Enyim.Caching</RootNamespace>
11   - <AssemblyName>Enyim.Caching</AssemblyName>
12   - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
13   - <TargetFrameworkSubset>
14   - </TargetFrameworkSubset>
15   - </PropertyGroup>
16   - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17   - <DebugSymbols>true</DebugSymbols>
18   - <DebugType>full</DebugType>
19   - <Optimize>false</Optimize>
20   - <OutputPath>bin\Debug\</OutputPath>
21   - <DefineConstants>DEBUG;TRACE</DefineConstants>
22   - <ErrorReport>prompt</ErrorReport>
23   - <WarningLevel>4</WarningLevel>
24   - <RunCodeAnalysis>false</RunCodeAnalysis>
25   - <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
26   - <CodeAnalysisRules>-Microsoft.Globalization#CA1301;-Microsoft.Globalization#CA1302;-Microsoft.Globalization#CA1306;-Microsoft.Globalization#CA1304;-Microsoft.Globalization#CA1305;-Microsoft.Globalization#CA2101;-Microsoft.Globalization#CA1300</CodeAnalysisRules>
27   - </PropertyGroup>
28   - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
29   - <DebugType>pdbonly</DebugType>
30   - <Optimize>true</Optimize>
31   - <OutputPath>bin\Release\</OutputPath>
32   - <DefineConstants>TRACE;SIGN</DefineConstants>
33   - <ErrorReport>prompt</ErrorReport>
34   - <WarningLevel>4</WarningLevel>
35   - <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
36   - <DocumentationFile>bin\Release\Enyim.Caching.XML</DocumentationFile>
37   - <RunCodeAnalysis>false</RunCodeAnalysis>
38   - <CodeAnalysisRules>-Microsoft.Design#CA1020;-Microsoft.Naming#CA1709;-Microsoft.Naming#CA1704</CodeAnalysisRules>
39   - </PropertyGroup>
40   - <ItemGroup>
41   - <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
42   - <SpecificVersion>False</SpecificVersion>
43   - <HintPath>..\binaries\log4net.dll</HintPath>
44   - </Reference>
45   - <Reference Include="System" />
46   - <Reference Include="System.configuration" />
47   - <Reference Include="System.Configuration.Install" />
48   - <Reference Include="System.Core">
49   - <RequiredTargetFramework>3.5</RequiredTargetFramework>
50   - </Reference>
51   - <Reference Include="System.Data" />
52   - <Reference Include="System.Web" />
53   - <Reference Include="System.Web.Extensions">
54   - <RequiredTargetFramework>3.5</RequiredTargetFramework>
55   - </Reference>
56   - <Reference Include="System.Xml" />
57   - </ItemGroup>
58   - <ItemGroup>
59   - <Compile Include="Configuration\AuthenticationConfiguration.cs" />
60   - <Compile Include="Configuration\ConfigurationHelper.cs" />
61   - <Compile Include="Configuration\AuthenticationElement.cs" />
62   - <Compile Include="Configuration\IAuthenticationConfiguration.cs" />
63   - <Compile Include="Configuration\SocketPoolConfiguration.cs" />
64   - <Compile Include="Memcached\Authentication\PlainTextAuthenticator.cs" />
65   - <Compile Include="Memcached\IAuthenticator.cs" />
66   - <Compile Include="Memcached\IMemcachedNode.cs" />
67   - <Compile Include="Memcached\IServerPool.cs" />
68   - <Compile Include="Memcached\IProtocolImplementation.cs" />
69   - <Compile Include="Memcached\ISaslAuthenticationProvider.cs" />
70   - <Compile Include="Memcached\Enums.cs" />
71   - <Compile Include="Memcached\KetamaNodeLocator.cs" />
72   - <Compile Include="Memcached\Operations\Binary\ConcatenationOperation.cs" />
73   - <Compile Include="Memcached\Operations\Binary\MultiGetOperation.cs" />
74   - <Compile Include="Memcached\Operations\Binary\SaslAuthenticator.cs" />
75   - <Compile Include="Memcached\Operations\Binary\FlushOperation.cs" />
76   - <Compile Include="Memcached\Operations\Binary\StatsOperation.cs" />
77   - <Compile Include="Memcached\Operations\Text\TextProtocol.cs" />
78   - <Compile Include="Memcached\Operations\Binary\BinaryProtocol.cs" />
79   - <Compile Include="HashCodeCombiner.cs" />
80   - <Compile Include="InterlockedQueue.cs" />
81   - <Compile Include="Memcached\CommandNotSupportedException.cs" />
82   - <Compile Include="Memcached\IMemcachedKeyTransformer.cs" />
83   - <Compile Include="Memcached\KeyTransformers\Base64KeyTransformer.cs" />
84   - <Compile Include="Memcached\KeyTransformers\DefaultKeyTransformer.cs">
85   - <SubType>Code</SubType>
86   - </Compile>
87   - <Compile Include="Memcached\KeyTransformers\KeyTransformerBase.cs" />
88   - <Compile Include="Memcached\KeyTransformers\SHA1KeyTransformer.cs" />
89   - <Compile Include="Memcached\KeyTransformers\TigerHashKeyTransformer.cs" />
90   - <Compile Include="Memcached\MemcachedNode.cs" />
91   - <Compile Include="Memcached\Operations\Binary\BinaryRequest.cs" />
92   - <Compile Include="Memcached\Operations\Binary\BinaryResponse.cs" />
93   - <Compile Include="Memcached\Operations\Binary\BinaryConverter.cs" />
94   - <Compile Include="Memcached\Operations\Binary\MutatorOperation.cs" />
95   - <Compile Include="Memcached\Operations\Binary\DeleteOperation.cs" />
96   - <Compile Include="Memcached\Operations\Binary\GetOperation.cs" />
97   - <Compile Include="Memcached\Operations\Binary\OpCode.cs" />
98   - <Compile Include="Memcached\Operations\Binary\StoreOperation.cs" />
99   - <Compile Include="Memcached\Operations\ItemOperation.cs" />
100   - <Compile Include="Memcached\Operations\Operation.cs" />
101   - <Compile Include="Memcached\Operations\Text\DecrementOperation.cs" />
102   - <Compile Include="Memcached\Operations\Text\DeleteOperation.cs" />
103   - <Compile Include="Memcached\Operations\Text\FlushOperation.cs" />
104   - <Compile Include="Memcached\Operations\Text\GetHelper.cs" />
105   - <Compile Include="Memcached\Operations\Text\GetOperation.cs" />
106   - <Compile Include="Memcached\Operations\Text\IncrementOperation.cs" />
107   - <Compile Include="Memcached\Operations\Text\MultiGetOperation.cs" />
108   - <Compile Include="Memcached\Operations\Text\TextSocketHelper.cs" />
109   - <Compile Include="Memcached\Operations\Text\StatsOperation.cs" />
110   - <Compile Include="Memcached\Operations\Text\StoreOperation.cs" />
111   - <Compile Include="Memcached\SingleNodeLocator.cs" />
112   - <Compile Include="Memcached\StatItem.cs" />
113   - <Compile Include="Memcached\Transcoders\DefaultTranscoder.cs" />
114   - <Compile Include="Configuration\IMemcachedClientConfiguration.cs" />
115   - <Compile Include="Configuration\EndPointElement.cs" />
116   - <Compile Include="Configuration\InterfaceValidator.cs" />
117   - <Compile Include="Configuration\ISocketPoolConfiguration.cs" />
118   - <Compile Include="Configuration\MemcachedClientConfiguration.cs" />
119   - <Compile Include="Configuration\SocketPoolElement.cs" />
120   - <Compile Include="Configuration\EndPointElementCollection.cs" />
121   - <Compile Include="FastActivator.cs" />
122   - <Compile Include="IFastObjectFacory.cs" />
123   - <Compile Include="Memcached\DefaultNodeLocator.cs" />
124   - <Compile Include="Memcached\IMemcachedNodeLocator.cs" />
125   - <Compile Include="FnvHash.cs" />
126   - <Compile Include="MemcachedClient.cs" />
127   - <Compile Include="Memcached\MemcachedClientException.cs" />
128   - <Compile Include="Configuration\MemcachedClientSection.cs" />
129   - <Compile Include="Memcached\MemcachedException.cs" />
130   - <Compile Include="Memcached\PooledSocket.cs" />
131   - <Compile Include="Memcached\ServerStats.cs" />
132   - <Compile Include="Memcached\ThrowHelper.cs" />
133   - <Compile Include="Memcached\Transcoders\CacheItem.cs" />
134   - <Compile Include="Memcached\Transcoders\ITranscoder.cs" />
135   - <Compile Include="NorthScale.Store\BucketConfigListener.cs" />
136   - <Compile Include="NorthScale.Store\Configuration\BucketPortType.cs" />
137   - <Compile Include="NorthScale.Store\ConfigManager.cs" />
138   - <Compile Include="NorthScale.Store\Configuration\INorthScaleClientConfiguration.cs" />
139   - <Compile Include="NorthScale.Store\Configuration\NorthScaleClientConfiguration.cs" />
140   - <Compile Include="NorthScale.Store\Configuration\NorthScaleClientSection.cs" />
141   - <Compile Include="NorthScale.Store\Configuration\ServersElement.cs" />
142   - <Compile Include="NorthScale.Store\Configuration\UriElement.cs" />
143   - <Compile Include="NorthScale.Store\Configuration\UriElementCollection.cs" />
144   - <Compile Include="NorthScale.Store\Configuration\UriValidator.cs" />
145   - <Compile Include="NorthScale.Store\Deserialization.cs" />
146   - <Compile Include="NorthScale.Store\MessageStreamListener.cs" />
147   - <Compile Include="NorthScale.Store\NorthScaleClient.cs" />
148   - <Compile Include="NorthScale.Store\NorthScalePool.cs" />
149   - <Compile Include="Properties\AssemblyInfo.cs" />
150   - <Compile Include="Memcached\ServerPool.cs" />
151   - <Compile Include="Memcached\StoreMode.cs" />
152   - <Compile Include="TigerHash.cs" />
153   - <Compile Include="UIntEqualityComparer.cs" />
154   - </ItemGroup>
155   - <ItemGroup>
156   - <None Include="App.config" />
157   - </ItemGroup>
158   - <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
159   - <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
160   - Other similar extension points exist, see Microsoft.Common.targets.
161   - <Target Name="BeforeBuild">
162   - </Target>
163   - <Target Name="AfterBuild">
164   - </Target>
165   - -->
  1 +<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  2 + <PropertyGroup>
  3 + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
  4 + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
  5 + <ProductVersion>9.0.30729</ProductVersion>
  6 + <SchemaVersion>2.0</SchemaVersion>
  7 + <ProjectGuid>{D438C0B3-A168-40B8-BDDD-61F0939DFF35}</ProjectGuid>
  8 + <OutputType>Library</OutputType>
  9 + <AppDesignerFolder>Properties</AppDesignerFolder>
  10 + <RootNamespace>Enyim.Caching</RootNamespace>
  11 + <AssemblyName>Enyim.Caching</AssemblyName>
  12 + <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
  13 + <TargetFrameworkSubset>
  14 + </TargetFrameworkSubset>
  15 + </PropertyGroup>
  16 + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
  17 + <DebugSymbols>true</DebugSymbols>
  18 + <DebugType>full</DebugType>
  19 + <Optimize>false</Optimize>
  20 + <OutputPath>bin\Debug\</OutputPath>
  21 + <DefineConstants>DEBUG;TRACE</DefineConstants>
  22 + <ErrorReport>prompt</ErrorReport>
  23 + <WarningLevel>4</WarningLevel>
  24 + <RunCodeAnalysis>false</RunCodeAnalysis>
  25 + <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
  26 + <CodeAnalysisRules>-Microsoft.Globalization#CA1301;-Microsoft.Globalization#CA1302;-Microsoft.Globalization#CA1306;-Microsoft.Globalization#CA1304;-Microsoft.Globalization#CA1305;-Microsoft.Globalization#CA2101;-Microsoft.Globalization#CA1300</CodeAnalysisRules>
  27 + </PropertyGroup>
  28 + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
  29 + <DebugType>pdbonly</DebugType>
  30 + <Optimize>true</Optimize>
  31 + <OutputPath>bin\Release\</OutputPath>
  32 + <DefineConstants>TRACE;SIGN</DefineConstants>
  33 + <ErrorReport>prompt</ErrorReport>
  34 + <WarningLevel>4</WarningLevel>
  35 + <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
  36 + <DocumentationFile>bin\Release\Enyim.Caching.XML</DocumentationFile>
  37 + <RunCodeAnalysis>false</RunCodeAnalysis>
  38 + <CodeAnalysisRules>-Microsoft.Design#CA1020;-Microsoft.Naming#CA1709;-Microsoft.Naming#CA1704</CodeAnalysisRules>
  39 + </PropertyGroup>
  40 + <ItemGroup>
  41 + <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
  42 + <SpecificVersion>False</SpecificVersion>
  43 + <HintPath>..\binaries\log4net.dll</HintPath>
  44 + </Reference>
  45 + <Reference Include="System" />
  46 + <Reference Include="System.configuration" />
  47 + <Reference Include="System.Configuration.Install" />
  48 + <Reference Include="System.Core">
  49 + <RequiredTargetFramework>3.5</RequiredTargetFramework>
  50 + </Reference>
  51 + <Reference Include="System.Data" />
  52 + <Reference Include="System.Web" />
  53 + <Reference Include="System.Web.Extensions">
  54 + <RequiredTargetFramework>3.5</RequiredTargetFramework>
  55 + </Reference>
  56 + <Reference Include="System.Xml" />
  57 + </ItemGroup>
  58 + <ItemGroup>
  59 + <Compile Include="Configuration\AuthenticationConfiguration.cs" />
  60 + <Compile Include="Configuration\ConfigurationHelper.cs" />
  61 + <Compile Include="Configuration\AuthenticationElement.cs" />
  62 + <Compile Include="Configuration\IAuthenticationConfiguration.cs" />
  63 + <Compile Include="Configuration\SocketPoolConfiguration.cs" />
  64 + <Compile Include="Memcached\Authentication\PlainTextAuthenticator.cs" />
  65 + <Compile Include="Memcached\IAuthenticator.cs" />
  66 + <Compile Include="Memcached\IMemcachedNode.cs" />
  67 + <Compile Include="Memcached\IServerPool.cs" />
  68 + <Compile Include="Memcached\IProtocolImplementation.cs" />
  69 + <Compile Include="Memcached\ISaslAuthenticationProvider.cs" />
  70 + <Compile Include="Memcached\Enums.cs" />
  71 + <Compile Include="Memcached\KetamaNodeLocator.cs" />
  72 + <Compile Include="Memcached\Operations\Binary\ConcatenationOperation.cs" />
  73 + <Compile Include="Memcached\Operations\Binary\MultiGetOperation.cs" />
  74 + <Compile Include="Memcached\Operations\Binary\SaslAuthenticator.cs" />
  75 + <Compile Include="Memcached\Operations\Binary\FlushOperation.cs" />
  76 + <Compile Include="Memcached\Operations\Binary\StatsOperation.cs" />
  77 + <Compile Include="Memcached\Operations\Text\TextProtocol.cs" />
  78 + <Compile Include="Memcached\Operations\Binary\BinaryProtocol.cs" />
  79 + <Compile Include="HashCodeCombiner.cs" />
  80 + <Compile Include="InterlockedQueue.cs" />
  81 + <Compile Include="Memcached\CommandNotSupportedException.cs" />
  82 + <Compile Include="Memcached\IMemcachedKeyTransformer.cs" />
  83 + <Compile Include="Memcached\KeyTransformers\Base64KeyTransformer.cs" />
  84 + <Compile Include="Memcached\KeyTransformers\DefaultKeyTransformer.cs">
  85 + <SubType>Code</SubType>
  86 + </Compile>
  87 + <Compile Include="Memcached\KeyTransformers\KeyTransformerBase.cs" />
  88 + <Compile Include="Memcached\KeyTransformers\SHA1KeyTransformer.cs" />
  89 + <Compile Include="Memcached\KeyTransformers\TigerHashKeyTransformer.cs" />
  90 + <Compile Include="Memcached\MemcachedNode.cs" />
  91 + <Compile Include="Memcached\Operations\Binary\BinaryRequest.cs" />
  92 + <Compile Include="Memcached\Operations\Binary\BinaryResponse.cs" />
  93 + <Compile Include="Memcached\Operations\Binary\BinaryConverter.cs" />
  94 + <Compile Include="Memcached\Operations\Binary\MutatorOperation.cs" />
  95 + <Compile Include="Memcached\Operations\Binary\DeleteOperation.cs" />
  96 + <Compile Include="Memcached\Operations\Binary\GetOperation.cs" />
  97 + <Compile Include="Memcached\Operations\Binary\OpCode.cs" />
  98 + <Compile Include="Memcached\Operations\Binary\StoreOperation.cs" />
  99 + <Compile Include="Memcached\Operations\ItemOperation.cs" />
  100 + <Compile Include="Memcached\Operations\Operation.cs" />
  101 + <Compile Include="Memcached\Operations\Text\DecrementOperation.cs" />
  102 + <Compile Include="Memcached\Operations\Text\DeleteOperation.cs" />
  103 + <Compile Include="Memcached\Operations\Text\FlushOperation.cs" />
  104 + <Compile Include="Memcached\Operations\Text\GetHelper.cs" />
  105 + <Compile Include="Memcached\Operations\Text\GetOperation.cs" />
  106 + <Compile Include="Memcached\Operations\Text\IncrementOperation.cs" />
  107 + <Compile Include="Memcached\Operations\Text\MultiGetOperation.cs" />
  108 + <Compile Include="Memcached\Operations\Text\TextSocketHelper.cs" />
  109 + <Compile Include="Memcached\Operations\Text\StatsOperation.cs" />
  110 + <Compile Include="Memcached\Operations\Text\StoreOperation.cs" />
  111 + <Compile Include="Memcached\SingleNodeLocator.cs" />
  112 + <Compile Include="Memcached\StatItem.cs" />
  113 + <Compile Include="Memcached\Transcoders\DefaultTranscoder.cs" />
  114 + <Compile Include="Configuration\IMemcachedClientConfiguration.cs" />
  115 + <Compile Include="Configuration\EndPointElement.cs" />
  116 + <Compile Include="Configuration\InterfaceValidator.cs" />
  117 + <Compile Include="Configuration\ISocketPoolConfiguration.cs" />
  118 + <Compile Include="Configuration\MemcachedClientConfiguration.cs" />
  119 + <Compile Include="Configuration\SocketPoolElement.cs" />
  120 + <Compile Include="Configuration\EndPointElementCollection.cs" />
  121 + <Compile Include="FastActivator.cs" />
  122 + <Compile Include="IFastObjectFacory.cs" />
  123 + <Compile Include="Memcached\DefaultNodeLocator.cs" />
  124 + <Compile Include="Memcached\IMemcachedNodeLocator.cs" />
  125 + <Compile Include="FnvHash.cs" />
  126 + <Compile Include="MemcachedClient.cs" />
  127 + <Compile Include="Memcached\MemcachedClientException.cs" />
  128 + <Compile Include="Configuration\MemcachedClientSection.cs" />
  129 + <Compile Include="Memcached\MemcachedException.cs" />
  130 + <Compile Include="Memcached\PooledSocket.cs" />
  131 + <Compile Include="Memcached\ServerStats.cs" />
  132 + <Compile Include="Memcached\ThrowHelper.cs" />
  133 + <Compile Include="Memcached\Transcoders\CacheItem.cs" />
  134 + <Compile Include="Memcached\Transcoders\ITranscoder.cs" />
  135 + <Compile Include="NorthScale.Store\BucketConfigListener.cs" />
  136 + <Compile Include="NorthScale.Store\Configuration\BucketPortType.cs" />
  137 + <Compile Include="NorthScale.Store\ConfigManager.cs">
  138 + </Compile>
  139 + <Compile Include="NorthScale.Store\Configuration\INorthScaleClientConfiguration.cs" />
  140 + <Compile Include="NorthScale.Store\Configuration\NorthScaleClientConfiguration.cs" />
  141 + <Compile Include="NorthScale.Store\Configuration\NorthScaleClientSection.cs" />
  142 + <Compile Include="NorthScale.Store\Configuration\ServersElement.cs" />
  143 + <Compile Include="NorthScale.Store\Configuration\UriElement.cs" />
  144 + <Compile Include="NorthScale.Store\Configuration\UriElementCollection.cs" />
  145 + <Compile Include="NorthScale.Store\Configuration\UriValidator.cs" />
  146 + <Compile Include="NorthScale.Store\WebClientWithTimeout.cs">
  147 + <SubType>Component</SubType>
  148 + </Compile>
  149 + <Compile Include="NorthScale.Store\Deserialization.cs" />
  150 + <Compile Include="NorthScale.Store\MessageStreamListener.cs" />
  151 + <Compile Include="NorthScale.Store\NorthScaleClient.cs" />
  152 + <Compile Include="NorthScale.Store\NorthScalePool.cs" />
  153 + <Compile Include="Properties\AssemblyInfo.cs" />
  154 + <Compile Include="Memcached\ServerPool.cs" />
  155 + <Compile Include="Memcached\StoreMode.cs" />
  156 + <Compile Include="TigerHash.cs" />
  157 + <Compile Include="UIntEqualityComparer.cs" />
  158 + </ItemGroup>
  159 + <ItemGroup>
  160 + <None Include="App.config" />
  161 + </ItemGroup>
  162 + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  163 + <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
  164 + Other similar extension points exist, see Microsoft.Common.targets.
  165 + <Target Name="BeforeBuild">
  166 + </Target>
  167 + <Target Name="AfterBuild">
  168 + </Target>
  169 + -->
166 170 </Project>
5 Enyim.Caching/Memcached/MemcachedNode.cs
@@ -421,11 +421,6 @@ public void Dispose()
421 421 }
422 422 }
423 423
424   - private void CheckDisposed()
425   - {
426   - if (this.isDisposed) throw new ObjectDisposedException("pool");
427   - }
428   -
429 424 void IDisposable.Dispose()
430 425 {
431 426 this.Dispose();
48 Enyim.Caching/NorthScale.Store/ConfigManager.cs
@@ -11,46 +11,22 @@ internal class ConfigHelper
11 11 {
12 12 private static log4net.ILog log = log4net.LogManager.GetLogger(typeof(ConfigHelper));
13 13
14   - private WebClient client;
  14 + private WebClientWithTimeout wcwt;
15 15
16   - public ConfigHelper() { }
17   -
18   - public ICredentials Credentials { get; set; }
19   -
20   - /// <summary>
21   - /// Creates a WebClient for communicating with the REST API.
22   - /// </summary>
23   - /// <param name="credentials"></param>
24   - /// <returns></returns>
25   - public static WebClient CreateClient(ICredentials credentials)
  16 + public ConfigHelper()
26 17 {
27   - var retval = new WebClient();
28   -
29   - retval.Credentials = credentials;
30   -
31   - retval.Headers[HttpRequestHeader.CacheControl] = "no-cache";
32   - retval.Headers[HttpRequestHeader.Accept] = "application/com.northscale.store+json";
33   - // TODO mayvbe we should version this
34   - retval.Headers[HttpRequestHeader.UserAgent] = "enyim.com memcached client";
35   -
36   - retval.Encoding = Encoding.UTF8;
37   -
38   - return retval;
  18 + this.wcwt = new WebClientWithTimeout();
39 19 }
40 20
41   - private WebClient GetWebClient()
  21 + public ICredentials Credentials
42 22 {
43   - if (this.client == null)
44   - {
45   - this.client = CreateClient(this.Credentials);
46   - }
47   -
48   - return this.client;
  23 + get { return this.wcwt.Credentials; }
  24 + set { this.wcwt.Credentials = value; }
49 25 }
50 26
51 27 private T DeserializeUri<T>(Uri uri)
52 28 {
53   - var info = this.GetWebClient().DownloadString(uri);
  29 + var info = this.wcwt.DownloadString(uri);
54 30 var jss = new JavaScriptSerializer();
55 31
56 32 return jss.Deserialize<T>(info);
@@ -134,6 +110,16 @@ public BucketNode[] GetWorkingNodes(Uri[] pools, string name)
134 110
135 111 return null;
136 112 }
  113 +
  114 + public int Timeout
  115 + {
  116 + get { return this.wcwt.Timeout; }
  117 + set
  118 + {
  119 + this.wcwt.Timeout = value;
  120 + this.wcwt.ReadWriteTimeout = value;
  121 + }
  122 + }
137 123 }
138 124 }
139 125
2  Enyim.Caching/NorthScale.Store/Configuration/NorthScaleClientConfiguration.cs
@@ -18,7 +18,7 @@ public class NorthScaleClientConfiguration : INorthScaleClientConfiguration
18 18 private Type transcoder;
19 19 private ICredentials credentials;
20 20 private string bucket;
21   - private BucketPortType port = BucketPortType.Direct;
  21 + private BucketPortType port = BucketPortType.Proxy;
22 22
23 23 /// <summary>
24 24 /// Initializes a new instance of the <see cref="T:MemcachedClientConfiguration"/> class.
2  Enyim.Caching/NorthScale.Store/Configuration/ServersElement.cs
@@ -49,7 +49,7 @@ public UriElementCollection Urls
49 49 /// <summary>
50 50 /// Determines which port the client should use to connect to the nodes
51 51 /// </summary>
52   - [ConfigurationProperty("port", IsRequired = false, DefaultValue=BucketPortType.Direct)]
  52 + [ConfigurationProperty("port", IsRequired = false, DefaultValue=BucketPortType.Proxy)]
53 53 public BucketPortType Port
54 54 {
55 55 get { return (BucketPortType)base["port"]; }
26 Enyim.Caching/NorthScale.Store/MessageStreamListener.cs
@@ -32,16 +32,14 @@ public MessageStreamListener(Uri[] urls)
32 32
33 33 protected virtual WebClient CreateClient()
34 34 {
35   - var client = new WebClient();
36   -
37   - client.Credentials = this.Credentials;
38   - client.Headers[HttpRequestHeader.CacheControl] = "no-cache";
39   - client.Headers[HttpRequestHeader.Accept] = "application/com.northscale.store+json";
40   - client.Headers[HttpRequestHeader.UserAgent] = "enyim.com memcached client";
41   -
42   - client.Encoding = Encoding.UTF8;
43   -
44   - return client;
  35 + return new WebClientWithTimeout()
  36 + {
  37 + Credentials = this.Credentials,
  38 + // make it infinite so it will not stop abort the socket thinking that the server have died
  39 + ReadWriteTimeout = System.Threading.Timeout.Infinite,
  40 + // this is just the connect timeout
  41 + Timeout = this.Timeout
  42 + };
45 43 }
46 44
47 45 /// <summary>
@@ -76,7 +74,8 @@ private void Work(object state)
76 74 if (log.IsDebugEnabled) log.Debug("Started working.");
77 75
78 76 Uri[] urls = this.urls;
79   - using (var client = ConfigHelper.CreateClient(this.Credentials))
  77 +
  78 + using (var client = this.CreateClient())
80 79 {
81 80 var worker = this.currentWorker = new MessageReader(client, this.OnMessageReceived);
82 81
@@ -140,6 +139,8 @@ private void Work(object state)
140 139 }
141 140 catch (Exception e)
142 141 {
  142 + log.Error("POOLFAIL", e);
  143 +
143 144 if (e is IOException || e is System.Net.WebException)
144 145 {
145 146 // current worker failed, most probably the pool it was connected to went down
@@ -186,6 +187,9 @@ protected virtual void OnConnectionAborted()
186 187 //if (log.IsDebugEnabled) log.Debug("Aborted");
187 188 }
188 189
  190 +
  191 + public int Timeout { get; set; }
  192 +
189 193 #region [ MessageReader ]
190 194 private class MessageReader
191 195 {
2  Enyim.Caching/NorthScale.Store/NorthScalePool.cs
@@ -91,6 +91,7 @@ void IServerPool.Start()
91 91
92 92 var cm = new ConfigHelper();
93 93 cm.Credentials = this.configuration.Credentials;
  94 + cm.Timeout = (int)this.configuration.SocketPool.ConnectionTimeout.TotalMilliseconds;
94 95
95 96 // get the nodes of the specified buctek using the pool urls
96 97 var nodes = cm.GetWorkingNodes(this.poolUrls, this.bucketName ?? "default");
@@ -108,6 +109,7 @@ void IServerPool.Start()
108 109 // create a config listener
109 110 this.configListener = new BucketConfigListener(streamingUris, nodes);
110 111 this.configListener.Credentials = this.configuration.Credentials;
  112 + this.configListener.Timeout = cm.Timeout;
111 113
112 114 // recreate the node lcoator when the config changes
113 115 this.configListener.NodeListChanged += InitNodes;
57 Enyim.Caching/NorthScale.Store/WebClientWithTimeout.cs
... ... @@ -0,0 +1,57 @@
  1 +using System;
  2 +using System.Collections.Generic;
  3 +using System.Linq;
  4 +using System.Net;
  5 +using System.Text;
  6 +using System.Web.Script.Serialization;
  7 +
  8 +namespace NorthScale.Store
  9 +{
  10 + internal class WebClientWithTimeout : WebClient
  11 + {
  12 + public WebClientWithTimeout()
  13 + {
  14 + this.Encoding = Encoding.UTF8;
  15 +
  16 + this.Headers[HttpRequestHeader.CacheControl] = "no-cache";
  17 + this.Headers[HttpRequestHeader.Accept] = "application/com.northscale.store+json";
  18 + // TODO mayvbe we should version this
  19 + this.Headers[HttpRequestHeader.UserAgent] = "enyim.com memcached client";
  20 + }
  21 +
  22 + protected override WebRequest GetWebRequest(Uri address)
  23 + {
  24 + var retval = base.GetWebRequest(address);
  25 + retval.Timeout = this.Timeout;
  26 +
  27 + var hrw = retval as HttpWebRequest;
  28 + if (hrw != null)
  29 + hrw.ReadWriteTimeout = this.ReadWriteTimeout;
  30 +
  31 + return retval;
  32 + }
  33 +
  34 + public int ReadWriteTimeout { get; set; }
  35 + public int Timeout { get; set; }
  36 + }
  37 +}
  38 +
  39 +#region [ License information ]
  40 +/* ************************************************************
  41 + *
  42 + * Copyright (c) 2010 Attila Kiskó, enyim.com
  43 + *
  44 + * Licensed under the Apache License, Version 2.0 (the "License");
  45 + * you may not use this file except in compliance with the License.
  46 + * You may obtain a copy of the License at
  47 + *
  48 + * http://www.apache.org/licenses/LICENSE-2.0
  49 + *
  50 + * Unless required by applicable law or agreed to in writing, software
  51 + * distributed under the License is distributed on an "AS IS" BASIS,
  52 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  53 + * See the License for the specific language governing permissions and
  54 + * limitations under the License.
  55 + *
  56 + * ************************************************************/
  57 +#endregion
15 MemcachedTest/App.config
@@ -14,10 +14,11 @@
14 14 <enyim.com>
15 15 <memcached>
16 16 <servers>
17   - <add address="127.0.0.1" port="20002" />
  17 + <add address="192.168.2.80" port="11211" />
  18 + <!--<add address="127.0.0.1" port="20002" />
18 19 <add address="127.0.0.1" port="20004" />
19 20 <add address="127.0.0.1" port="20006" />
20   - <add address="127.0.0.1" port="20008" />
  21 + <add address="127.0.0.1" port="20008" />-->
21 22 </servers>
22 23 <socketPool minPoolSize="10" maxPoolSize="100" connectionTimeout="00:00:10" />
23 24 </memcached>
@@ -27,20 +28,22 @@
27 28
28 29 <binaryConfig protocol="Binary">
29 30 <servers>
30   - <add address="127.0.0.1" port="20002" />
  31 + <add address="192.168.2.80" port="11211" />
  32 + <!--<add address="127.0.0.1" port="20002" />
31 33 <add address="127.0.0.1" port="20004" />
32 34 <add address="127.0.0.1" port="20006" />
33   - <add address="127.0.0.1" port="20008" />
  35 + <add address="127.0.0.1" port="20008" />-->
34 36 </servers>
35 37 <socketPool minPoolSize="10" maxPoolSize="100" connectionTimeout="00:00:10" />
36 38 </binaryConfig>
37 39
38 40 <textConfig protocol="Text">
39 41 <servers>
40   - <add address="127.0.0.1" port="20002" />
  42 + <add address="192.168.2.80" port="11211" />
  43 + <!--<add address="127.0.0.1" port="20002" />
41 44 <add address="127.0.0.1" port="20004" />
42 45 <add address="127.0.0.1" port="20006" />
43   - <add address="127.0.0.1" port="20008" />
  46 + <add address="127.0.0.1" port="20008" />-->
44 47 </servers>
45 48 <socketPool minPoolSize="10" maxPoolSize="100" connectionTimeout="00:00:10" />
46 49 </textConfig>

0 comments on commit f265b92

Please sign in to comment.
Something went wrong with that request. Please try again.