Page 1 of 1

socket buffer related problem

Posted: Mon Apr 18, 2011 10:14 am
by xdriver
Hi,
I'm converting socket reading program written in delphi into livecode using following syntax.

read from socket for read_bytes chars with message 'pkt_read'

When read_bytes is less than 20k there's no delay reading socket data.
But when read_bytes is about 35k the livecode program waits about 5 or more seconds to read socket data.
And at that moment, livecode sends lots of socketTimeout event. I set socketTimeoutInterval to 1000.
And on server side, sending program also waits to flush.
This means livecode program doesn't clear socket buffer after a read.
( I made test delphi program for this. When client doen't read socket buffer, server program waits for some time to flush )

Is there a way to set socket buffer size ?
Or is this a bug which is to be fixed ?

Re: socket buffer related problem

Posted: Mon Apr 18, 2011 10:36 am
by bangkok
A message from 2005, with (apparently) the same issue (LiveCode list)

http://lists.runrev.com/pipermail/use-l ... 52864.html

Which version of LiveCode do you use ?

Re: socket buffer related problem

Posted: Mon Apr 18, 2011 12:02 pm
by BvG
note that socket timeout is sent periodically, and has nothing to do with actual timing out or not. Basically if there's no traffik, socket timeout is to be expected.

Re: socket buffer related problem

Posted: Mon Apr 18, 2011 5:00 pm
by mwieder
That's a *very* short timeout interval. You will probably want to increase it to something more than one second. 35k bytes is a lot of packets - no doubt you're hitting timeouts before getting to the end.

Re: socket buffer related problem

Posted: Tue Apr 19, 2011 1:06 am
by xdriver
Thanks for the replies.

I'm using Livecode 4.6.
And I know timeout is natural for socket handleing but in my case it takse to much time to read data.
And in case of delphi program it's a snap to read whole packet.
As I said before, when timeout happens, on server side sending program cannot flush socket buffer becase of client side buffer is not cleared.