Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

I am sending request for receving image byte array.
for 1 image i am getting 3 images of size 2000, 1000 , 3000 total - 6000 bytes for 1 image .
for receiving response I am allocating memory as per the number of images to receive.
But problem arize if there are more number of images , and brew gives liking error if i allocat memory more than 80000-90000.
But in my program i required to allocate memory for 30 images so 30 * 6000 . or may be number of images may inscrese.

So , i am sending request for limited images in while loop. But , GetResponse function does not give any response.

What care should be taken if i want to send 4-5 request recursively.
there is no any sleep or wait function in brew.
I tried using Set_timer but , it does not works.

pApp->imgcntst = 0;
pApp->imgcntend = -1;
while(pApp->imgcntend < pApp->imagecount-1 )
{
pApp->imgcntst = pApp->imgcntend + 1 ;
pApp->imgcntend = pApp->imgcntend + 4;
if(pApp->imgcntend > pApp->imagecount )
pApp->imgcntend = pApp->imagecount -1;
SendHttpRequest(pApp,9);//to get image
// ISHELL_SetTimer( pApp->a.m_pIShell,3000,(PFNNOTIFY)SendHttpRequest,pApp,9);

if i SendHttpRequest(pApp,9);//to get image
without while loop it works.

SendHttpRequest()
{
HttpCall_FreeAppData(pApp);
mcoupons_BuildURL(pApp);
HttpCall_InitAppData(pApp);
MakeHttpCall(pApp);

static void MakeHttpCall( MIApp *pApp )
{
FOR_ALL_WEBACTIONS( pApp, p, WebAction_Start( p, pApp->m_pszURL ) );
WebAction_DisplayProgressBar(pApp);
return;

static void WebAction_Start(WebAction *pwa, char *pszUrl)
{
MIApp * pApp = pwa->pParent;
CALLBACK_Init( &pwa->cb, WebAction_GotResp, pwa );

IWEB_GetResponse( pApp->m_pIWeb,
( pApp->m_pIWeb, &pwa->piWResp, &pwa>cb,pszUrl,WEBOPT_HANDLERDATA, pwa,
WEBOPT_HEADER, pApp->header ,
WEBOPT_HEADERHANDLER, WebAction_Header,
WEBOPT_END ));

Please tell me how to take care if i want to send reuest in loop

Please reply, How to take indication that response is received and read.

Please reply, How to take indication that response is received and read.

Since in brew i cannot allocated enough memory for receiving response which is byte array of images.
I split request , but don't know when to start next recurssive request .what is the indication that first response is read completelty and processed and the send next request.

Since in brew i cannot allocated enough memory for receiving response which is byte array of images.
I split request , but don't know when to start next recurssive request .what is the indication that first response is read completelty and processed and the send next request.

you can get to know reading data for a request is complete when isource end state occurs... then probably you can go for the next request...
you can also do it in a single request just by allowing yourself to read as much data required to save an image to the efs and continue with reading next image and save it... the process should go on till you finish all the images..

you can get to know reading data for a request is complete when isource end state occurs... then probably you can go for the next request...
you can also do it in a single request just by allowing yourself to read as much data required to save an image to the efs and continue with reading next image and save it... the process should go on till you finish all the images..