Sockets - send()

Kenneth Brody kenbrody at bestweb.net
Thu Oct 30 15:25:00 PDT 2008


Quoting Nancy Palmquist (Thu, 30 Oct 2008 18:02:31 -0400):

> Anyone using the sockets logic in filePro, I was wondering if anyone  
>  had an idea about this.
[... sends 4000 bytes through socket, but recv's 1490 on the other end...]
> rx(4000)=""
> length=recv(accept_handle,rx)
>
> If I display the value of LENGTH, it will show "1490" and I am   
> missing the end of my file.
[...]
> Any suggestions would be helpful.  All the records that are smaller than 1490
> seem to work flawlessly.

It's a part of the TCP/IP design that messages can be broken up into
smaller chunks, which can be reassembled at the other end.  In you call
recv() for a length of 4000 before they have all arrived on the other
end, recv() can return just the part that has been received.  If you
call recv() again, you'll get the next chunk that comes, and so on.

In this case, it appears that the connection has been set to break things
up into 1490-byte chunks.  (If you check your network settings, you will
probably see an "MTU" value of 1500.)

As I recall, filePro's RECV() function has a flag to tell it to wait until
the entire length has been received (or an error occurs), but I'm not in
front of a system where I can check how to pass it.

-- 
KenBrody at BestWeb dot net        spamtrap: <g8ymh8uf001 at sneakemail.com>
http://www.hvcomputer.com
http://www.fileProPlus.com


More information about the Filepro-list mailing list