Esempio n. 1
0
static Bool
RecvSTATUS_Redirect(
	DBG_Struct	*dbg)
{
	int dbstatus;
	Bool rc = FALSE;
	if		(  dbg->fpLog  !=  NULL  ) {
		SendPacketClass(dbg->fpLog, RED_STATUS);	ON_IO_ERROR(dbg->fpLog,badio);
		dbstatus = RecvChar(dbg->fpLog);	ON_IO_ERROR(dbg->fpLog,badio);
		ChangeDBStatus_Redirect(dbg, dbstatus);
	}
	rc = TRUE;
badio:
	return rc;
}
std::vector<char> s13WXWServer::RecvChar ()
{
    std::vector<char> aryReturn;
    unsigned int uiSocketsLength = aryClientSockets.size ();

    aryReceivedFrom.clear ();

    for (unsigned int uiIdx = 0; uiIdx < uiSocketsLength; uiIdx++)
    {
        char adtReturn = RecvChar (aryClientSockets.at (uiIdx));

        aryReturn.push_back (adtReturn);
        aryReceivedFrom.push_back (uiIdx);
    }

    return (aryReturn);
}
Esempio n. 3
0
static	SessionData	*
ReadTerminal(
	NETFILE		*fp,
	SessionData	*data)
{
	LD_Node			*ld;
	Bool			fExit;
	int				c;
	LargeByteString	*scrdata;
	int				i;
ENTER_FUNC;
	fExit = FALSE;
	while (!fExit) {
		switch (c = RecvPacketClass(fp)) {
		case WFC_DATA:
			dbgmsg("recv DATA");
			if (data != NULL) {
				RecvnString(fp,SIZE_NAME,data->hdr->window);
					ON_IO_ERROR(fp,badio);
				RecvnString(fp,SIZE_NAME,data->hdr->widget);
					ON_IO_ERROR(fp,badio);
				RecvnString(fp,SIZE_NAME,data->hdr->event);
					ON_IO_ERROR(fp,badio);

				data->w.sp = RecvInt(fp);					
					ON_IO_ERROR(fp,badio);
				for (i=0;i<data->w.sp ;i++) {
					data->w.s[i].puttype = RecvChar(fp);
						ON_IO_ERROR(fp,badio);
					RecvnString(fp,SIZE_NAME,data->w.s[i].window);
						ON_IO_ERROR(fp,badio);
				}

				dbgprintf("window = [%s]",data->hdr->window);
				dbgprintf("widget = [%s]",data->hdr->widget);
				dbgprintf("event  = [%s]",data->hdr->event);
				ld = g_hash_table_lookup(ComponentHash,data->hdr->window);
				if (ld != NULL) {
					dbgprintf("ld = [%s]",ld->info->name);
					dbgprintf("window = [%s]",data->hdr->window);
					scrdata = GetScreenData(data,data->hdr->window);
					if (scrdata != NULL) {
						SendPacketClass(fp,WFC_OK);	ON_IO_ERROR(fp,badio);
						dbgmsg("send OK");
						if (RecvPacketClass(fp) == WFC_DATA) {
							RecvLBS(fp,scrdata);ON_IO_ERROR(fp,badio);
						}
						data->hdr->puttype = SCREEN_NULL;
					} else {
						Error("invalid window [%s]",data->hdr->window);
					}
					if (data->ld != ld) {
						ChangeLD(data,ld);
					}
				} else {
					Error("component [%s] not found.",data->hdr->window);
					fExit = TRUE;
				}
			} else {
				fExit = TRUE;
			}
			break;
		case WFC_OK:
			dbgmsg("OK");
			fExit = TRUE;
			break;
		case WFC_END:
			dbgmsg("END");
			if ((ld = g_hash_table_lookup(APS_Hash, "session"))  !=  NULL) {
				strncpy(data->hdr->window,"session_end",
					sizeof(data->hdr->window));
				data->hdr->widget[0] = 0;
				sprintf(data->hdr->event,"SESSIONEND");
				data->hdr->puttype = SCREEN_NULL;
				ChangeLD(data,ld);
				data->status = SESSION_STATUS_END;
			} else {
				data->status = SESSION_STATUS_ABORT;
			}
			fExit = TRUE;
			break;
		default:
			Warning("Invalid PacketClass in ReadTerminal [%X]", c);
			SendPacketClass(fp,WFC_NOT);ON_IO_ERROR(fp,badio);
			fExit = TRUE;
			data->status = SESSION_STATUS_ABORT;
			break;
		}
	}
badio:
LEAVE_FUNC;
	return(data);
}