socket size limit?

J. Landman Gay jacque at hyperactivesw.com
Wed Mar 9 11:40:10 EST 2005


On 3/9/05 7:13 AM, Nicolas Cueto wrote:

> Hello List,
> 
> When reading data from a socket, is there some kind of default size limit
> for the data?
> 
> I'm sending about 3000 lines of data (cr delimited, each line 1-20
> characters long) from a server stack to a client stack. The server stack
> appears to be sending out the data intact, but at the client end the data
> becomes truncated somewhere around the 2100th line.

There can be a problem with "short reads" on some client connections. 
Here is a quote from Scott Raney:

> Now "read .. until empty" was never a good idea, merely a quick and
> dirty way to read whatever should be incoming in the first bufferfull
> from the HTTP server.  Unfortunately the easy workaround, "read from
> stdin for $CONTENT_LENGTH" also doesn't work if the process on the
> other end of stdin doesn't keep up.  So what you have to do instead is
> something like:
>   put empty into buffer # this is where your data will end up
>   repeat until length(buffer) >= $CONTENT_LENGTH
>     read from stdin until empty
>     put it after buffer
>   end repeat
> 


-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com


More information about the use-livecode mailing list