Groups > Symbian > Symbian EPOC connect > Junk Values - Http Request Header Content Pblm




Re: Junk Values - Http Request Header Content Pblm

Re: Junk Values - Http Request Header Content Pblm
08 Jul 2006 10:19:14 +0300
Possible causes:

- RecvOneMore can return anything from 1-1024 bytes, you have to have
  a loop that reads and appends data until end of file.

- you don't check error return on iStatus (maybe you get carbage
  because nothing is actually read -- there is some error?) (your code
  doesn't show how you actually open the socket)

Post Reply
Junk Values - Http Request Header Content Pblm
Sat, 8 Jul 2006 11:11:35 +0530
 Hi ....
        i'm doing a server in symbian in which it listens for the connection 
from a browser set with loopback address & port no 9393 ....when i open the

browser & type any site in it ...for example if i type "
www.google.com" 
this request shld be accepted and the information such as Get Host Http 
........... and all these shld be received in a buffer & written to a file 
......here is the code snippet wat i had done........file is created but 
garbage is there in it....full garbage is there....this is the code snippet 
i used to receive content & store in the file.....

void ReceiveMessageL()
{
 fsSession.Connect();
 fsSession.MkDirAll(KDirName);
 file.Replace(fsSession,KFileName,EFileWrite);

 TBuf8<1024> buffer;
 iSocket.RecvOneOrMore(buffer,0,iStatus,iLen);

 User::WaitForRequest(iStatus);
 file.Write(buffer);
 file.Close();
 fsSession.Close();
}

This is the file content :::::

 ױPP@
   &A       ,*A x*A           h>A P@A ">A  ?A BA <?A  
lNA pU@
o   ?A (UP?A pU@ >A                     ?A l   ?A >A pU@
">A >A T
?A           xUP    8   ?A                        ?A pU@
0  lNA pU@                   lNA (UPBA pU@ l?A                     tAA
  lNA "?A pU@ <?A XAA   lNA           xUP      lNA  
pAA
~   OAA PPP
           8@A 
                  ?                          
   ?A    OAA   OAA 3PpU@                     
       
   @A
   ">A                                            3PpU@
          ?              lNA                       lNA pU@
?   OBA ױPP@     T

       )A # (A       ~CA
   0   "CA pU@                    "CA  V@    "CA @ 

Post Reply
about | contact