rstudio / httpuv

HTTP and WebSocket server package for R
Other
229 stars 86 forks source link

Before closing handle, make sure it is not already in closing state #145

Closed wch closed 6 years ago

wch commented 6 years ago

This fixes #144. On Windows, calling uv_close() on a handle does not close it immediately, but first puts it into a closing state. This makes sure we don't try to close it twice.

See here for an example: https://github.com/joyent/libuv/blob/master/test/task.h#L222-L225