MCPcopy Create free account
hub / github.com/aria2/aria2 / setReadCheckSocket

Method setReadCheckSocket

src/AbstractCommand.cc:542–562  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

540}
541
542void AbstractCommand::setReadCheckSocket(
543 const std::shared_ptr<SocketCore>& socket)
544{
545 if (!socket->isOpen()) {
546 disableReadCheckSocket();
547 return;
548 }
549
550 if (checkSocketIsReadable_) {
551 if (*readCheckTarget_ != *socket) {
552 e_->deleteSocketForReadCheck(readCheckTarget_, this);
553 e_->addSocketForReadCheck(socket, this);
554 readCheckTarget_ = socket;
555 }
556 return;
557 }
558
559 e_->addSocketForReadCheck(socket, this);
560 checkSocketIsReadable_ = true;
561 readCheckTarget_ = socket;
562}
563
564void AbstractCommand::setReadCheckSocketIf(
565 const std::shared_ptr<SocketCore>& socket, bool pred)

Callers 1

DHTSetup.ccFile · 0.45

Calls 3

addSocketForReadCheckMethod · 0.80
isOpenMethod · 0.45

Tested by

no test coverage detected