Lines Matching refs:hChannel
49 void HdcClient::NotifyInstanceChannelFree(HChannel hChannel)
53 ModifyTty(false, &hChannel->stdinTty);
474 HChannel hChannel = (HChannel)stream->data;
475 HdcClient *thisClass = (HdcClient *)hChannel->clsChannel;
476 char *cmd = hChannel->bufStd;
481 thisClass->Send(hChannel->channelId, reinterpret_cast<uint8_t *>(cmd), strlen(cmd));
482 Base::ZeroArray(hChannel->bufStd);
510 void HdcClient::BindLocalStd(HChannel hChannel)
521 if (uv_tty_init(loopMain, &hChannel->stdoutTty, STDOUT_FILENO, 0)
522 || uv_tty_init(loopMain, &hChannel->stdinTty, STDIN_FILENO, 1)) {
526 hChannel->stdoutTty.data = hChannel;
527 ++hChannel->uvHandleRef;
528 hChannel->stdinTty.data = hChannel;
529 ++hChannel->uvHandleRef;
532 ModifyTty(true, &hChannel->stdinTty);
533 uv_read_start((uv_stream_t *)&hChannel->stdinTty, AllocStdbuf, ReadStd);
542 HChannel hChannel = reinterpret_cast<HChannel>(thisClass->channel);
543 if (uv_is_closing((const uv_handle_t *)&hChannel->hWorkTCP)) {
545 thisClass->FreeChannel(hChannel->channelId);
551 thisClass->BindLocalStd(hChannel);
552 Base::SetTcpOptions((uv_tcp_t *)&hChannel->hWorkTCP);
554 uv_read_start((uv_stream_t *)&hChannel->hWorkTCP, AllocCallback, ReadStream);
562 thisClass->FreeChannel(hChannel->channelId);
572 HChannel hChannel = reinterpret_cast<HChannel>(thisClass->channel);
576 thisClass->FreeChannel(hChannel->channelId);
590 int HdcClient::PreHandshake(HChannel hChannel, const uint8_t *buf)
594 hChannel->availTailIndex = 0;
598 hChannel->isStableBuf = (hShake->banner[BANNER_FEATURE_TAG_OFFSET] != HUGE_BUF_TAG);
599 WRITE_LOG(LOG_DEBUG, "Channel PreHandshake isStableBuf:%d", hChannel->isStableBuf);
604 uint32_t unOld = hChannel->channelId;
605 hChannel->channelId = ntohl(hShake->channelId);
606 AdminChannel(OP_UPDATE, unOld, hChannel);
613 hChannel->availTailIndex = 0;
627 hChannel->availTailIndex = 0;
631 Send(hChannel->channelId, reinterpret_cast<uint8_t *>(hShake), sizeof(ChannelHandShake));
634 Send(hChannel->channelId, reinterpret_cast<uint8_t *>(hShake), offsetof(struct ChannelHandShake, version));
636 hChannel->handshakeOK = true;
639 Send(hChannel->channelId,
647 int HdcClient::ReadChannel(HChannel hChannel, uint8_t *buf, const int bytesIO)
649 if (!hChannel->handshakeOK) {
650 return PreHandshake(hChannel, buf);
671 if (hChannel->remote > RemoteType::REMOTE_NONE && bOffset) {
673 if (hChannel->remote == RemoteType::REMOTE_FILE) {
675 HTaskInfo hTaskInfo = GetRemoteTaskInfo(hChannel);
684 if (hChannel->remote == RemoteType::REMOTE_APP) {
686 HTaskInfo hTaskInfo = GetRemoteTaskInfo(hChannel);
797 HTaskInfo HdcClient::GetRemoteTaskInfo(HChannel hChannel)
800 hTaskInfo->channelId = hChannel->channelId;
805 hTaskInfo->isStableBuf = hChannel->isStableBuf;