Lines Matching refs:mSock
135 shared_ptr<Sock> mSock; member in loc_util::LocIpcLocalSender
137 inline virtual bool isOperable() const override { return mSock != nullptr && mSock->isValid(); } in isOperable()
139 return mSock->send(data, length, 0, (struct sockaddr*)&mAddr, sizeof(mAddr)); in send()
143 mSock(make_shared<Sock>((nullptr == name) ? -1 : (::socket(AF_UNIX, SOCK_DGRAM, 0)))), in LocIpcLocalSender()
145 if (mSock != nullptr && mSock->isValid()) {
155 return mSock->recv(mDataCb, 0, (struct sockaddr*)&mAddr, &size); in recv()
166 if (mSock->isValid() && ::bind(mSock->mSid, (struct sockaddr*)&mAddr, sizeof(mAddr)) < 0) { in LocIpcLocalRecver()
167 LOC_LOGe("bind socket error. sock fd: %d: %s, reason: %s", mSock->mSid, in LocIpcLocalRecver()
169 mSock->close(); in LocIpcLocalRecver()
176 mSock->sendAbort(0, (struct sockaddr*)&mAddr, sizeof(mAddr)); in abort()
184 shared_ptr<Sock> mSock; member in loc_util::LocIpcInetSender
187 inline virtual bool isOperable() const override { return mSock != nullptr && mSock->isValid(); } in isOperable()
189 return mSock->send(data, length, 0, (struct sockaddr*)&mAddr, sizeof(mAddr)); in send()
194 mSock(make_shared<Sock>((nullptr == name) ? -1 : (::socket(AF_INET, mSockType, 0)))), in LocIpcInetSender()
198 if (mSock != nullptr && mSock->isValid() && nullptr != name) {
214 ::connect(mSock->mSid, (const struct sockaddr*)&mAddr, sizeof(mAddr)); in send()
216 return mSock->send(data, length, 0, (struct sockaddr*)&mAddr, sizeof(mAddr)); in send()
234 if (mSock->isValid() && ::bind(mSock->mSid, (struct sockaddr*)&mAddr, sizeof(mAddr)) < 0) { in LocIpcInetRecver()
235 LOC_LOGe("bind socket error. sock fd: %d, reason: %s", mSock->mSid, strerror(errno)); in LocIpcInetRecver()
236 mSock->close(); in LocIpcInetRecver()
245 mSock->sendAbort(0, (struct sockaddr*)&loopBackAddr, sizeof(loopBackAddr)); in abort()
256 if (-1 == mConnFd && mSock->isValid()) { in recv()
257 if (::listen(mSock->mSid, 3) < 0 || in recv()
258 (mConnFd = accept(mSock->mSid, (struct sockaddr*)&mAddr, &size)) < 0) { in recv()
259 mSock->close(); in recv()
263 return mSock->recv(mDataCb, 0, (struct sockaddr*)&mAddr, &size, mConnFd); in recv()
276 return mSock->recv(mDataCb, 0, (struct sockaddr*)&mAddr, &size); in recv()