Esempio n. 1
0
bool CMultiXAppMsg::Reply(MultiXError	Error,int32_t MsgCode, const	CMultiXBufferArray &Bufs, int Flags,int Priority, uint32_t Timeout, void *Context,TMultiXProcID	RoutedFrom)
{
	if(ReplySent())
		return	false;
	if(!this->NotifyAny())
		return	false;
	if(!m_pProcess->SenderEnabled())
		return	false;
	if(m_pProcess->RestartCount()	!=	m_OwnerInstance)
		return	false;
	if(RoutedFrom	==	0)
		RoutedFrom	=	m_pProcess->Owner()->ProcessID();

	CMultiXAppMsg	*Msg	=	m_pProcess->CreateNewAppMsg();
	m_pProcess->AddToMsgQueue(m_pProcess->m_pOutQueue, Msg);
	Msg->AllocateL7XMsg(MsgCode);
	Msg->AddReceiverMsgID(this->SenderMsgID());
	if(this->IsCtrlMsgFromTpm())
		Flags	|=	FlagControlToTpm;
	else if(this->IsCtrlMsgToTpm())
		Flags	|=	FlagControlFromTpm;
	if(Bufs.Count()	==	0)
		Flags	&=	~CMultiXAppMsg::FlagResponseRequired;
	Msg->AddInfo(Bufs,Flags | FlagMsgIsResponse,this->m_SessionID,Priority,Timeout,Context,Error,RoutedFrom,NULL,NULL,NULL,NULL);
	if(Msg->NotifyAny())
		m_pProcess->Send(*Msg);
	else
	{
		m_pProcess->Send(*Msg);
		delete	Msg;
	}
	SetReplySent(true);
	return	true;
}
Esempio n. 2
0
bool CMultiXProcess::Send(int32_t MsgCode, const	CMultiXBufferArray	&Bufs,int Flags, const	TMultiXSessionID	&SessionID,int Priority, uint32_t Timeout, void *Context,TMultiXProcID	RoutedFrom,const	char	*WSURL,const	char	*WSSoapAction,const	char	*WSDllFile,const	char	*WSDllFunction)
{
    if(!SenderEnabled())
        return	false;
    CMultiXAppMsg	*Msg	=	CreateNewAppMsg();
    AddToMsgQueue(m_pOutQueue,Msg);
    Msg->AllocateL7XMsg(MsgCode);
    if(RoutedFrom	==	0)
        RoutedFrom	=	Owner()->ProcessID();
    Msg->AddInfo(Bufs,Flags & (~CMultiXAppMsg::FlagMsgIsResponse),SessionID,Priority,Timeout,Context,MultiXNoError,RoutedFrom,WSURL,WSSoapAction,WSDllFile,WSDllFunction);

    if(Msg->NotifyAny())
        return	Send(*Msg);
    else
    {
        Send(*Msg);
        delete	Msg;
    }
    return	true;
}