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, reason: %s", mSock->mSid, strerror(errno)); in LocIpcLocalRecver()
168 mSock->close(); in LocIpcLocalRecver()
175 mSock->sendAbort(0, (struct sockaddr*)&mAddr, sizeof(mAddr)); in abort()
182 shared_ptr<Sock> mSock; member in loc_util::LocIpcInetTcpSender
186 inline virtual bool isOperable() const override { return mSock != nullptr && mSock->isValid(); } in isOperable()
190 ::connect(mSock->mSid, (const struct sockaddr*)&mAddr, sizeof(mAddr)); in send()
192 return mSock->send(data, length, 0, (struct sockaddr*)&mAddr, sizeof(mAddr)); in send()
196 mSock(make_shared<Sock>((nullptr == name) ? -1 : (::socket(AF_INET, SOCK_STREAM, 0)))), in LocIpcInetTcpSender()
200 if (mSock != nullptr && mSock->isValid() && nullptr != name) {
214 if (-1 == mConnFd && mSock->isValid()) { in recv()
215 if (::listen(mSock->mSid, 3) < 0 || in recv()
216 (mConnFd = accept(mSock->mSid, (struct sockaddr*)&mAddr, &size)) < 0) { in recv()
217 mSock->close(); in recv()
221 return mSock->recv(mDataCb, 0, (struct sockaddr*)&mAddr, &size, mConnFd); in recv()
227 if (mSock->isValid() && ::bind(mSock->mSid, (struct sockaddr*)&mAddr, sizeof(mAddr)) < 0) { in LocIpcInetTcpRecver()
228 LOC_LOGe("bind socket error. sock fd: %d, reason: %s", mSock->mSid, strerror(errno)); in LocIpcInetTcpRecver()
229 mSock->close(); in LocIpcInetTcpRecver()
236 mSock->sendAbort(0, (struct sockaddr*)&mAddr, sizeof(mAddr)); in abort()