In general the send and receive loop in hbinet.c for mode == 1 is
from the beginning technical nonsense and this modifications instead
of fixing it added workaround which partially eliminates overhead
introduced by data fragmentation.
We should simply remove iRcvBufSize/iSndBufSize members from
HB_SOCKET_STRUCT and always use iMaxLen/iSend number of bytes.
The select() functions used before recv()/send() operation
informs us the it will be unblocked operation and system will
accept as much data as it will need choosing optimal value
without blocking application.
Of course we can keep new function to set internal buffer size
(SO_RCVBUF/SO_SNDBUF) for users which will want to change it.
iRcvBufSize/oSndBufSize now contents the maximum buffer assigned by
system, we need to know this value
saved at iRcvBufSize/oSndBufSize, because we can use only half of this
buffer for safe, almost
meanwhile we work with synchronous buffers.
IMPORTANT this buffers don't have a fix size almost at windows platform,
it depends of the free memory
system, by default 8kb. Normally we can try to increase it as necessary.
for example we have good rates
using 64kb bytes to transfer ftp and 16kb for http.
for this reason we can't remove iRcvBufSize/oSndBufSize, we need to know
this values to not use more
than half buffer to save.
Test using more size some time produce lost of data (windows platforms)
is possible that linux works better
and is possible to use full system buffer size.
You can say to me what is the default system buffer size at linux
platforms ?
Best regards,
Miguel Angel Marchuet
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour