On Wed, 24 Mar 2010, AbeB wrote:

Hi,

> I developed an Application to run on wince using netio. 
> I first wrote the app & compiled for w32 and it runs very well.
> 
> Then I compiled it for wce. Now if the handheld is connected via the Active
> Sync cable ( so it gets some kind of internal IP adddress) is work fine too.
> 
> But if the handheld is connected wirelessly the app will hang after a few
> I/Os. It will start working, ( connect, open some DBFs, seeks) but it will
> hang very soon. (the same happens with the test prg in hbnetio\tests)
> 
> Please if anybody  can work with me on this, I'm ready to compensate for it.
> ( Since this is very urgent for me).

It looks like a problem with transport layer.
TCP should always deliver packages if it's possible.
It should detect lost packages, wrong control sums, etc and
repeat transmission until success.
So 1-st you should check why the connections are lost.
Adding our own code which will try to make deliver verification
inside TCP stream technically is very bad idea. It can make
things only worse. Such verification can be done using UDP but
if TCP does not work (technically TCP is sth like UDP with additional
deliver verification code) then there is a big chance that our own
implementation will not work for exactly the same reasons (of course
if problem is not caused by some bugs in TCP implementation in drivers
used by your hardware).
In summary I cannot help you too much in HBNETIO code.
Probably the only one thing I can do is adding some more verbose
connection error reporting which maybe help you to locate the real
reason of problem. Seems that it's problem with some drivers in
your WinCE system and it may be hard to find workaround which can
be hardcoded inside HBNETIO code. But we can try.
I.e. you can start with modified netiocli.c replacing two loops
with the ones below.

best regards,
Przemek

   [...] s_fileRecvAll()

   while( lRead < len )
   {
      if( conn->zstream )
         l = hb_znetRead( conn->zstream, conn->sd, ptr + lRead, len - lRead, 
NETIO_TIMEOUT );
      else
         l = hb_socketRecv( conn->sd, ptr + lRead, len - lRead, 0, 
NETIO_TIMEOUT );
      if( l <= 0 )
      {
         if( hb_socketGetError() != HB_SOCKET_ERR_TIMEOUT ||
             hb_vmRequestQuery() != 0 )
            break;
      }
      lRead += l;
   }

   [...] s_fileSendMsg()

   while( lSent < len )
   {
      if( conn->zstream )
         l = hb_znetWrite( conn->zstream, conn->sd, msg + lSent, len - lSent, 
NETIO_TIMEOUT, &lLast );
      else
         l = lLast = hb_socketSend( conn->sd, msg + lSent, len - lSent, 0, 
NETIO_TIMEOUT );
      if( l > 0 )
         lSent += l;
      if( lLast <= 0 )
      {
         if( hb_socketGetError() != HB_SOCKET_ERR_TIMEOUT ||
             hb_vmRequestQuery() != 0 )
            break;
      }
   }
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to