4 ms·
In lthread-cpp (wrapper around lthread) it's even easier because of RAII. Example: http://lthread-cpp.readthedocs.org/en/latest/listener.html#examples http://l
by halayli 11y ago
In lthread-cpp (wrapper around lthread) it's even easier because of RAII. Example:
http://lthread-cpp.readthedocs.org/en/latest/listener.html#examples http://lthread-cpp.readthedocs.org/en/latest/listener.html#e...
TCPListener closes the socket once its done and cleans up. And it also allows you to pass instance methods as the coroutine which has the advantage of accessing the instance context.