2017-04-24 21:04:52 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
2017-04-27 20:44:30 +00:00
|
|
|
|
using Kneesocks;
|
2017-04-25 18:25:48 +00:00
|
|
|
|
using System.Net.Sockets;
|
2017-04-24 21:04:52 +00:00
|
|
|
|
|
|
|
|
|
namespace CircleScape {
|
|
|
|
|
static class PoolManager {
|
|
|
|
|
private static Pool<PendingConnection> PendingConnectionsPool;
|
|
|
|
|
private static Pool<ActiveConnection> ActiveConnectionsPool;
|
2017-05-11 21:03:28 +00:00
|
|
|
|
public static Pool<PendingConnection> Pending {
|
2017-05-04 12:21:27 +00:00
|
|
|
|
get {
|
|
|
|
|
return PendingConnectionsPool;
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-05-11 21:03:28 +00:00
|
|
|
|
public static Pool<ActiveConnection> Active {
|
|
|
|
|
get {
|
|
|
|
|
return ActiveConnectionsPool;
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-04-24 21:04:52 +00:00
|
|
|
|
|
|
|
|
|
static PoolManager() {
|
|
|
|
|
PendingConnectionsPool = new Pool<PendingConnection> {
|
|
|
|
|
InitialCount = 1,
|
|
|
|
|
InitialSize = 10,
|
|
|
|
|
SizeGrowth = 10,
|
|
|
|
|
MaxSize = 50,
|
|
|
|
|
MaxCount = 5
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ActiveConnectionsPool = new Pool<ActiveConnection>();
|
|
|
|
|
}
|
2017-05-12 21:05:18 +00:00
|
|
|
|
|
|
|
|
|
public static void Dispose() {
|
|
|
|
|
PendingConnectionsPool.Dispose();
|
|
|
|
|
ActiveConnectionsPool.Dispose();
|
|
|
|
|
}
|
2017-04-24 21:04:52 +00:00
|
|
|
|
}
|
|
|
|
|
}
|