示例#1
0
 public LeechServer(LeechPipeServerSocket socket)
 {
     _tickPipeServer = null;
     _core           = new LpCore(socket, true); // сервер
     _pipeFactory    = new LeechServerPipeFactory(_core);
     _sysPipe        = new SystemLp(_pipeFactory, _core);
     _core.Initialize(_sysPipe, "Pulxer", false);
 }
示例#2
0
        public async Task <bool> DeleteTickPipe()
        {
            if (_tickPipe == 0)
            {
                return(false);
            }

            bool isSuccess = await _sysPipe.DeletePipeAsync(_tickPipe);

            _tickPipeServer = null;

            return(isSuccess);
        }
示例#3
0
        public async Task <TickPipeServer> GetTickPipe()
        {
            if (_tickPipeServer != null)
            {
                return(_tickPipeServer);
            }

            _tickPipe = await _sysPipe.CreatePipeAsync(Encoding.UTF8.GetBytes("tick"));

            if (_tickPipe == 0)
            {
                return(null);
            }

            _tickPipeServer = new TickPipeServer(_core, _tickPipe);
            return(_tickPipeServer);
        }