Re: Strange experiences with coroutines while using Copas
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Strange experiences with coroutines while using Copas
- From: Eric Jacobs <eric@...>
- Date: 2005年8月22日 03:09:38 -0500
On 2005年8月21日 21:43:56 -0700
Chris Pressey <cpressey@catseye.mine.nu> wrote:
> local chunk, err = skt:receive(chunk_size)
I don't know if this is the problem, but Copas doesn't seem to
handle this case correctly if there aren't at least 'chunk_size'
bytes available on the socket to read. It asks for an additional
'chunk_size' bytes after the partial read, which is incorrect and
may cause you to read past the next packet boundary if enough
data is available.
This could also be considered a bug in LuaSocket (if it should
count the results of the previous read as part of the current
read); maybe the API needs to be hammered out a bit more?
Eric