Lines Matching refs:mSock
134 shared_ptr<Sock> mSock; member in loc_util::LocIpcLocalSender
136 inline virtual bool isOperable() const override { return mSock != nullptr && mSock->isValid(); } in isOperable()
138 return mSock->send(data, length, 0, (struct sockaddr*)&mAddr, sizeof(mAddr)); in send()
142 mSock(nullptr), in LocIpcLocalSender()
155 mSock.reset(new Sock(fd));
156 if (mSock != nullptr && mSock->isValid()) {
166 return mSock->recv(*this, mDataCb, 0, (struct sockaddr*)&mAddr, &size); in recv()
177 if (mSock->isValid() && ::bind(mSock->mSid, (struct sockaddr*)&mAddr, sizeof(mAddr)) < 0) { in LocIpcLocalRecver()
178 LOC_LOGe("bind socket error. sock fd: %d: %s, reason: %s", mSock->mSid, in LocIpcLocalRecver()
180 mSock->close(); in LocIpcLocalRecver()
187 mSock->sendAbort(0, (struct sockaddr*)&mAddr, sizeof(mAddr)); in abort()
195 shared_ptr<Sock> mSock; member in loc_util::LocIpcInetSender
198 inline virtual bool isOperable() const override { return mSock != nullptr && mSock->isValid(); } in isOperable()
200 return mSock->send(data, length, 0, (struct sockaddr*)&mAddr, sizeof(mAddr)); in send()
204 mSockType(sender.mSockType), mSock(sender.mSock), in LocIpcInetSender()
209 mSock(make_shared<Sock>((nullptr == name) ? -1 : (::socket(AF_INET, mSockType, 0)))), in LocIpcInetSender()
213 if (mSock != nullptr && mSock->isValid() && nullptr != name) {
222 return make_unique<SockRecver>(listener, *this, mSock); in getRecver()
233 ::connect(mSock->mSid, (const struct sockaddr*)&mAddr, sizeof(mAddr)); in send()
235 return mSock->send(data, length, 0, (struct sockaddr*)&mAddr, sizeof(mAddr)); in send()
253 if (mSock->isValid() && ::bind(mSock->mSid, (struct sockaddr*)&mAddr, sizeof(mAddr)) < 0) { in LocIpcInetRecver()
254 LOC_LOGe("bind socket error. sock fd: %d, reason: %s", mSock->mSid, strerror(errno)); in LocIpcInetRecver()
255 mSock->close(); in LocIpcInetRecver()
264 mSock->sendAbort(0, (struct sockaddr*)&loopBackAddr, sizeof(loopBackAddr)); in abort()
277 if (-1 == mConnFd && mSock->isValid()) { in recv()
278 if (::listen(mSock->mSid, 3) < 0 || in recv()
279 (mConnFd = accept(mSock->mSid, (struct sockaddr*)&mAddr, &size)) < 0) { in recv()
280 mSock->close(); in recv()
284 return mSock->recv(*this, mDataCb, 0, (struct sockaddr*)&mAddr, &size, mConnFd); in recv()
297 return mSock->recv(*this, mDataCb, 0, (struct sockaddr*)&mAddr, &size); in recv()