Error TMsgSocket::Open(const Address* addr, long timeout, bool async, const CompletionContainer<const Socket::OpenResult&>& completion) { if (!completion.empty()) { IntermediateOpenCompletion* intermediateCompletion = new IntermediateOpenCompletion(this, completion, true); intermediateCompletion->completion.OwnCompletion(); return actualSocket->Open(addr, timeout, async, intermediateCompletion); } return actualSocket->Open(addr, timeout, async); }
void TMsgSocket::CatchRecvable(const CompletionContainer<const Result&>& completion, bool reuse) { if (!completion.empty()) { IntermediateCompletion* intermediateCompletion = new IntermediateCompletion(this, completion, true); intermediateCompletion->completion.OwnCompletion(); actualSocket->CatchRecvable(intermediateCompletion, reuse); } else actualSocket->CatchRecvable(completion, reuse); }
void TMsgSocket::Close(long timeout, bool async, const CompletionContainer<const Result&>& completion) { if (!completion.empty()) { IntermediateCompletion* intermediateCompletion = new IntermediateCompletion(this, completion, true); intermediateCompletion->completion.OwnCompletion(); actualSocket->Close(timeout, async, intermediateCompletion); } else actualSocket->Close(timeout, async); }