/// <summary> /// Initializes a new instance of the <see cref="Server" /> class. /// </summary> /// <param name="entry"> /// 進入點物件 /// </param> public Service(IEntry entry, int port, IProtocol protocol, Regulus.Network.IListenable server) { _ThreadCoreHandler = new ThreadCoreHandler(entry); _ThreadSocketHandler = new ThreadSocketHandler(port, _ThreadCoreHandler, protocol, server); _WaitSocket = new AutoResetEvent(false); }
public ThreadSocketHandler(int port, ThreadCoreHandler core_handler, IProtocol protocol, IListenable server) { _CoreHandler = core_handler; _Protocol = protocol; _Port = port; _Sockets = new Queue <IPeer>(); _Peers = new PeerSet(); _Spin = new PowerRegulator(); _AutoPowerRegulator = new AutoPowerRegulator(_Spin); _Server = server; }