void AsioSessionState::write( const std::vector<ByteBuffer> &byteBuffers) { RCF_ASSERT(!byteBuffers.empty()); Lock lock(mSessionPtr->mDisableIoMutex); if (!mSessionPtr->mDisableIo) { if (mSocketOpsMutexPtr) { Lock lock(*mSocketOpsMutexPtr); implWrite(byteBuffers); } else { implWrite(byteBuffers); } } }
void AsioSessionState::write( const std::vector<ByteBuffer> &byteBuffers) { RCF2_TRACE("")(this); // TODO: send all the buffers at once // ... RCF_ASSERT(!byteBuffers.empty()); char *buffer = byteBuffers.front().getPtr(); std::size_t bufferLen = byteBuffers.front().getLength(); Lock lock(mMutex); if (!mHasBeenClosed) { implWrite(buffer, bufferLen); } }