Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Membase 1.6 compatibility.

The hostname in the bucket list in 1.6 contains the management port too, not just the IP.
  • Loading branch information...
commit 07218f2f7f5c74e82b13a2cf6d4baffb9f483d66 1 parent 9d2c29d
Attila Kiskó authored July 26, 2010
11  Northscale.Store/Deserialization.cs
... ...
@@ -1,4 +1,5 @@
1 1
 using System.Collections.Generic;
  2
+using System.Net;
2 3
 
3 4
 namespace NorthScale.Store
4 5
 {
@@ -31,6 +32,16 @@ public override int GetHashCode()
31 32
 
32 33
 		internal static readonly IEqualityComparer<BucketNode> ComparerInstance = new Comparer();
33 34
 
  35
+		public IPAddress GetIP()
  36
+		{
  37
+			var tmp = this.hostname;
  38
+			var index = tmp.IndexOf(':');
  39
+			if (index > 0)
  40
+				tmp = tmp.Substring(0, index);
  41
+
  42
+			return IPAddress.Parse(tmp);
  43
+		}
  44
+
34 45
 		#region [ Comparer                     ]
35 46
 		private class Comparer : IEqualityComparer<BucketNode>
36 47
 		{
2  Northscale.Store/NorthScalePool.cs
@@ -127,7 +127,7 @@ private void InitNodes(IEnumerable<BucketNode> nodes)
127 127
 			var mcNodes = nodes.Select(b => new MemcachedNode(
128 128
 				// create a memcached node for each bucket node
129 129
 				// TODO currently we expect that the API returns IP addresses, we should confirm this
130  
-												new IPEndPoint(IPAddress.Parse(b.hostname),
  130
+												new IPEndPoint(b.GetIP(),
131 131
 																	portType == BucketPortType.Proxy ? b.ports.proxy : b.ports.direct),
132 132
 												this.configuration.SocketPool,
133 133
 												auth)).ToArray();

0 notes on commit 07218f2

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