Lines Matching refs:hChannel

573     HChannel hChannel = sfc->AdminChannel(OP_QUERY_REF, channelId, nullptr);
574 if (!hChannel) {
587 if (hChannel->isDead) {
589 --hChannel->ref;
594 sfc->EchoClientRaw(hChannel, payload, payloadSize);
600 sfc->EchoClient(hChannel, level, s.c_str());
626 Base::TryCloseHandle((uv_handle_t *)&hChannel->hChildWorkTCP); // detch client channel
641 if (hChannel->fromClient) {
643 sfc->SendCommandToClient(hChannel, command, payload, payloadSize);
647 HSession hSessionByQuery = AdminSession(OP_QUERY, hChannel->targetSessionId, nullptr);
656 --hChannel->ref;
897 HChannel hChannel = hSfc->AdminChannel(OP_QUERY_REF, channelId, nullptr);
898 if (!hChannel) {
899 WRITE_LOG(LOG_DEBUG, "AttachChannel hChannel null channelId:%u", channelId);
902 uv_tcp_init(&hSession->childLoop, &hChannel->hChildWorkTCP);
903 hChannel->hChildWorkTCP.data = hChannel;
904 hChannel->targetSessionId = hSession->sessionId;
905 if ((ret = uv_tcp_open((uv_tcp_t *)&hChannel->hChildWorkTCP, hChannel->fdChildWorkTCP)) < 0) {
910 buf, hChannel->channelId, hChannel->fdChildWorkTCP);
911 Base::TryCloseHandle((uv_handle_t *)&hChannel->hChildWorkTCP);
912 --hChannel->ref;
915 Base::SetTcpOptions((uv_tcp_t *)&hChannel->hChildWorkTCP);
916 uv_read_start((uv_stream_t *)&hChannel->hChildWorkTCP, hSfc->AllocCallback, hSfc->ReadStream);
917 --hChannel->ref;
924 HChannel hChannel = hSfc->AdminChannel(OP_QUERY, channelId, nullptr);
925 if (!hChannel) {
929 WRITE_LOG(LOG_WARN, "DeatchChannel hChannel null channelId:%u", channelId);
932 if (hChannel->childCleared) {
939 Send(hSession->sessionId, hChannel->channelId, CMD_KERNEL_CHANNEL_CLOSE, &count, 1);
940 WRITE_LOG(LOG_DEBUG, "Childchannel begin close, cid:%u, sid:%u", hChannel->channelId, hSession->sessionId);
941 if (uv_is_closing((const uv_handle_t *)&hChannel->hChildWorkTCP)) {
942 Base::DoNextLoop(&hSession->childLoop, hChannel, [](const uint8_t flag, string &msg, const void *data) {
943 HChannel hChannel = (HChannel)data;
944 hChannel->childCleared = true;
945 WRITE_LOG(LOG_DEBUG, "Childchannel free direct, cid:%u", hChannel->channelId);
948 if (hChannel->hChildWorkTCP.loop == NULL) {
949 WRITE_LOG(LOG_DEBUG, "Childchannel loop is null, cid:%u", hChannel->channelId);
951 Base::TryCloseHandle((uv_handle_t *)&hChannel->hChildWorkTCP, [](uv_handle_t *handle) -> void {
952 HChannel hChannel = (HChannel)handle->data;
953 hChannel->childCleared = true;
954 WRITE_LOG(LOG_DEBUG, "Childchannel free callback, cid:%u", hChannel->channelId);
963 HChannel hChannel = hSfc->AdminChannel(OP_QUERY, channelId, nullptr);
965 if (!hChannel || !hSession) {