void nsServerSocket::OnMsgClose() { SOCKET_LOG(("nsServerSocket::OnMsgClose [this=%p]\n", this)); if (NS_FAILED(mCondition)) return; // tear down socket. this signals the STS to detach our socket handler. mCondition = NS_BINDING_ABORTED; // if we are attached, then we'll close the socket in our OnSocketDetached. // otherwise, call OnSocketDetached from here. if (!mAttached) OnSocketDetached(mFD); }
void nsUDPSocket::OnMsgAttach() { UDPSOCKET_LOG(("nsUDPSocket::OnMsgAttach [this=%p]\n", this)); if (NS_FAILED(mCondition)) return; mCondition = TryAttach(); // if we hit an error while trying to attach then bail... if (NS_FAILED(mCondition)) { NS_ASSERTION(!mAttached, "should not be attached already"); OnSocketDetached(mFD); } }
void nsUDPSocket::OnMsgClose() { UDPSOCKET_LOG(("nsUDPSocket::OnMsgClose [this=%p]\n", this)); if (NS_FAILED(mCondition)) return; // tear down socket. this signals the STS to detach our socket handler. mCondition = NS_BINDING_ABORTED; // if we are attached, then socket transport service will call our // OnSocketDetached method automatically. Otherwise, we have to call it // (and thus close the socket) manually. if (!mAttached) OnSocketDetached(mFD); }