lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

I took a look into a few libs but not COPAS. I was not aware of it, but it seems
to do what I implemented now :/. I was messing up with the :send / :receive
return values when an error occurred. I did not take into account that the data
would be partially sent and that I would need to take care of that (instead I
resend the whole batch in case of an error).
After taking a look on a few other libs (i.e. gnet binding), I remembered having
read something about return values in case of errors with the luasocket
functions and I reread the manuals exactly (typical rtfm). After fixing this
issue, it's working fine now for my case and the code got also simpler by now.
I simply send the packet size ahead and the receiver reads it using a coroutine
until all has been received. In the end it was also not so complicated, but I
struggled until it was working - I hope it will continue working now.


> Hi,
> > I am currently trying to use luasocket but when
> > sending/receiving large data packages, my code is messing
> > up.
> Can you elaborate? Also, have you taken a look at COPAS?
> []s,
> Diego