<...>

> As you can see, when the coroutine finishes Copas closes *the socket
> that coroutine was awakened with*. So if you do a copas.send, it
> yields, and then you exit after coming back, Copas closes the socket
> that you sent to. If Javier is here he can tell if that is indeed the
> intended behavior or not. :-)

I see.

> If you remove the skt:close() line then your code should be fine,
> although you will now have to remember to close all sockets, unless
> you are ok with letting the GC do it. :-)

Well, I do always explicitly connections, so that should be acceptable.

Except that I hate to live on patched third party dependencies.

What about adding an option in copas? I can produce a patch myself if
needed, if you say which fix is the most appropriate in this case.

I believe this unexpected behaviour is a bug. If copas handler is tied
to a single connection, then it should assert when resumed with wrong
connection — this would save users (like me) a lot of debugging...
Also: is this limitation documented anywhere?

Thank you!
Alexander.

_______________________________________________
Kepler-Project mailing list
Kepler-Project@lists.luaforge.net
http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project
http://www.keplerproject.org/

Reply via email to