HitProxy.Connection.CachedServer.GetNewConnection C# (CSharp) Method

GetNewConnection() public method

Creates and return a new connection. If the maximum number of connections to that server is reached, it will return null.
public GetNewConnection ( ) : CachedConnection
return CachedConnection
        public CachedConnection GetNewConnection()
        {
            CachedConnection c = new CachedConnection (this);
            lock (connections) {
                if (connections.Count >= max) {
                    return null;
                }
                connections.Add (c);
            }
            c.Connect ();
            return c;
        }