This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problems with BSD socket functions

I have been trying to write a simple FTP client using the BSD socket functions, but find I have 2 problems:

1. When trying to use the recv() function when specifying a buffer size smaller than the packet size transmitted by the server I get a memory corrupt error (trapped in the sys_error() function of net_config.c). Ie the server sends blocks of data in 1460 byte chunks and I call the recv function with a buffer of 1024 bytes, so I get the server packet in 2 chunks.
If I call the recv() function with a buffer of > 1460 bytes then it seems to work, although I saw it fail with memory corruption once.

2. When the server has finished sending the data it closes the data connection, however the recv() function has not yet read the last packet, but cannot as the recv() call now returns SCK_EINVALID, ie I lose the final packet of data.

Anyone else had these issues?

I am going back to the slightly more tedious but as far as I know working method of TCP/IP programming with RL-TCPnet!!

Parents Reply Children
No data