public CachedConnection GetNewConnection() { CachedConnection c = new CachedConnection (this); lock (connections) { if (connections.Count >= max) { return null; } connections.Add (c); } c.Connect (); return c; }