regarding E32USER CBase 46
Login to reply to this topic.
Mon, 2008-06-23 08:06
Joined: 2008-04-16
Forum posts: 24

can u tell me y this occurs
i know this will occur panic in active scheduler
can u tell me at wht what cases it will occur
i am use setactive and CPeriodic


Mon, 2008-06-23 10:10
Joined: 2008-01-16
Forum posts: 231

Hi arumilli,

For Stray signal (E32USER-CBase 46)there will be only one of three reasons:-

1. CActiveScheduler::Add() was not called when the active object was constructed.
2. SetActive() was not called following the submission of a request to the asynchronous service provider.
3. The asynchronous service provider completed the TRequestStatus of an active object more than once – either because of “when an already-completed request is cancelled” or ”more than one request was submitted simultaneously on the same active object."

Hope this will be helpful for you.!


Thanks & Regards,
Md.Khalid Ahmad

Mon, 2008-06-23 10:24
Joined: 2007-09-24
Forum posts: 95

hi
I think ,Either You are calling SetActive() function twice for Only One Asynchronous Request OR calling Only One SetActive() for two or more Asynchronous Request , Check your code again If you couldn't figure out the problem post you code here
Praveen

Mon, 2008-06-23 12:38
Joined: 2008-04-16
Forum posts: 24

thank u guys
here is my code

CEampleclass::CEampleclass() : CActive( EPriorityStandard )	// Standard priority
{
iPeriodicTimer = CPeriodic::NewL(CActive::EPriorityIdle);
	User::LeaveIfError( iTimer.CreateLocal() );	// Initialize timer
	CActiveScheduler::Add( this );// Add to scheduler
call_handle =new (ELeave)CG7MobileSettingItemListView();
void CEampleclass::ShowDialog()
{
iNote = CAknGlobalConfirmationQuery::NewL();
iNote->ShowConfirmationQueryL(iStatus ,_L( "Incoming call" ),R_AVKON_SOFTKEYS_CALL_CANCEL);
if(!IsActive())
{
if(iStatus.Int()==EAknSoftkeyCall)
{}
SetActive();
}

iPeriodicTimer->Start(
1000000,1000000,
TCallBack(PeriodicTimerCallBack, this));

}
TInt CEampleclass:: PeriodicTimerCallBack(TAny* aAny)
{

CEampleclass* self = static_cast<CEampleclass*>( aAny );
self->SomeFunction();

return KErrNone;

}


void CEampleclass::SomeFunction()
{
// TODO: Your code!
if(((CEampleclass*)(CCoeEnv::Static()->AppUi()))->disconnect >1)
Cancel();

}
void CEampleclass::ShowDialog1()
{
((CEampleclass*)(CCoeEnv::Static()->AppUi()))->disconnect=0;
iNote = CAknGlobalConfirmationQuery::NewL();
iNote->ShowConfirmationQueryL(iStatus ,_L( "Connected" ),R_AVKON_SOFTKEYS_BACK);
if(!IsActive())
{
if(iStatus.Int()==EAknSoftkeyCall)
{}
SetActive();
}

iPeriodicTimer->Start(
1000000,1000000,
TCallBack(PeriodicTimerCallBack, this));
}
void CEampleclass::RunL()
{


iPeriodicTimer->Cancel();

if(iStatus.Int()==EAknSoftkeyCall)
{


ShowDialog1();
}else if(iStatus.Int()==EAknSoftkeyBack ||iStatus.Int()==EAknSoftkeyClose)
{

CAknGlobalNote* globalNote2 = CAknGlobalNote::NewLC();
globalNote2->ShowNoteL( EAknGlobalTextNote, _L("disconnect") );
CleanupStack::PopAndDestroy( globalNote2 );

}
else if(iStatus.Int()==EAknSoftkeyCancel)
{

CAknGlobalNote* globalNote2 = CAknGlobalNote::NewLC();
globalNote2->ShowNoteL( EAknGlobalTextNote, _L("disconnect") );
CleanupStack::PopAndDestroy( globalNote2 );

}
void CEampleclass::DoCancel()
{
iNote->CancelConfirmationQuery();
iPeriodicTimer->Cancel();
}

Mon, 2008-06-23 16:07
Joined: 2007-09-24
Forum posts: 95

if(!IsActive())
{
if(iStatus.Int()==EAknSoftkeyCall)
{
//**//
}
SetActive();
}
can you tell me for which Asynchronous function are you calling SetActive() ;
Thanks and Regard
Praveen K . S.

Thu, 2008-11-06 09:30
Joined: 2008-11-06
Forum posts: 3

 TInetAddr address;
TRequestStatus iStatus;
RHostResolver resolver;
TNameEntry entry;

User::LeaveIfError(resolver.Open(iSocketServ, KAfInet, KProtocolInetTcp));
CleanupClosePushL( resolver );
resolver.GetByName(_L("192.168.2.24"), entry);

CleanupStack::PopAndDestroy();//for resolver

address.SetAddress((TInetAddr::Cast(entry().iAddr)).Address());
address.SetPort(2801);
User::LeaveIfError(clientSockId.Open(iSocketServ, KAfInet, KSockStream, KProtocolInetTcp));


clientSockId.Connect(address, iStatus);
User::WaitForRequest(iStatus);
if(iStatus == KErrNone)
{
_LIT(KTLS1,"TLS1.0");
iTlsSocket = CSecureSocket::NewL(clientSockId,KTLS1);
iTlsSocket->FlushSessionCache();
iTlsSocket->StartClientHandshake(iStatus);
User::WaitForRequest(iStatus);
User::LeaveIfError(iStatus.Int());
if(iStatus == KErrNone)
readDatastrt(); //read welcome after handshake
}

its hangs out after StartClientHandshake

Thu, 2008-11-06 11:36
Joined: 2003-01-14
Forum posts: 2133

Create an active object to handle your socket.


Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant

Fri, 2008-11-07 15:31
Joined: 2008-11-06
Forum posts: 3

void Foo::RunL()
{
switch ( iRunState )
{
case ESocketConnected:
MakeSecureConnectionL();
break;

case ESecureConnected:
MakePageRequestL();
break;

case EGetRequestSent:
GetServerResponseL();
break;

case EDataReceived:
ReadServerResponseL();
break;

case EConnectionClosed:
//closeConnection();
break;

default:

break;
} // end switch
}

void Foo::MakePageRequestL()
{
// The secure connection has now been made.
// Send a get request for the page.
TInt Len = iStatus.Int();
User::LeaveIfError(iStatus.Int());
// Send the request
iRunState = EGetRequestSent;
iTlsSocket->Send( iSndBuffer, iStatus, iBytesSent );
SetActive();
}
void Foo::GetServerResponseL()
{
// The get request has been sent, can now try and receive the data
User::LeaveIfError(iStatus.Int());
TSockXfrLength dataLength;
// Read asynchonously-returns when buffer full
iRunState = EDataReceived;
iTlsSocket->RecvOneOrMore(iRcvBuffer,iStatus,dataLength);
if((iRcvBuffer.Length()==0) || (iRcvBuffer.Locate('\n'))!=0 )
{

}
SetActive();
}

void Foo::ReadServerResponseL()
{
// Any error other than KErrEof means the test is a failure
if (iStatus!=KErrEof) User::LeaveIfError(iStatus.Int());
TSockXfrLength dataLength;
// Put the received data in the output file & reset the receive buffer
iTotalBytesRead += iRcvBuffer.Length();

// Case 1: error is KErrEof (message complete) or no data received, so stop
if ( ( iStatus==KErrEof ) || ( iRcvBuffer.Length() == 0 ) )
{
// Close the socket neatly
iRunState = EConnectionClosed;
iTimer.After( iStatus, 1000000 );
SetActive();
return;
}

// Case 2: there's more data to get from the server
iRcvBuffer.SetLength( 0 );
iRunState = EDataReceived;
iTlsSocket->RecvOneOrMore(iRcvBuffer,iStatus,dataLength);
SetActive();
}

1. After Clienthandsake happen.. i have received "welcome" msg.
2. after tat sending some data
3. receiving some response for the data.

next.. i want to send data again.
wat is the procedure for tat? because "ReadServerResponseL" iRunState = EDataReceived;

can u pls help me out from this problem


copyright 2003-2009 NewLC SARL