I use the NetUWriteN with a change in the size of block (chunck) for 4k, see
below. This change it was to try skirt this error that I am having. I
think what cause is what, the stack TCP is full, the NetLibSend waiting to
be able to place more data in stack TCP and timeout, however my time is
high, the only explanation that I see is that the reply of the packages sent
(Acknologe) this not arriving palmtop.
What you think?
Int32 NetUWriteN2(NetSocketRef fd, UInt8 * ptr, UInt32 nbytes)
{
Int32 nleft;
Int16 chunk;
Int16 nwritten;
Err error;
nleft = nbytes;
while (nleft > 0)
{
if (nleft > 4096)
chunk = 4096;
else
chunk = nleft;
nwritten = NetLibSend(geFtpHandle.uiNetLibRef, fd, (UInt8 *) ptr,
chunk,0,0,0, geFtpHandle.timeout_ticks,&erro);
if (nwritten <= 0)
{
fun_ftp_logint("NetUWriteN error", erro, 0);
return false;
}
nleft -= nwritten;
ptr += nwritten;
}
return (nbytes - nleft);
}
Thanks for the attention,
----- Original Message -----
From: "Ben Combee" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[email protected]>
Sent: Friday, July 29, 2005 2:54 PM
Subject: Re: NetLibSend problem
At 12:27 PM 7/29/2005, you wrote:
Hi,
I have the sources LFTP program (LFTP 1.61)
I'm using CW9 and NetLib to develop application that sends/receives files
to and from FTP server.
The problem is in the NetLibSend. To send small files up to 30 kbytes I do
not have problems, however how much necessary to send large files, 30
kbytes or more the NetLibSend returns error. I observed several
commentaries in this same forum with problems in this same function,
already I tried the found tips, for example, many people speak that the
chunck sent for the server has that to be small 512 bytes and also to
reduce the speed of the connection, but don´t solve the problem.
Somebody has the solution for this problem?
Are you using an "int" to hold your position in the data to send? If so,
you may be hitting the 16-bit limit for int variables which can represent
-32K to +32K. Try using a long instead to keep track of offset
values. This also applies to pointer arithmetic and array offsets.
-- Ben Combee, Senior Software Engineer, palmOne, Inc.
"Combee on Palm OS" weblog: http://palmos.combee.net/
Developer Forum Archives: http://news.palmos.com/read/all_forums/
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/
_______________________________________________________
Yahoo! Acesso Grátis - Internet rápida e grátis.
Instale o discador agora! http://br.acesso.yahoo.com/
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/