jaspervdj / websockets

A Haskell library for creating WebSocket-capable servers
http://jaspervdj.be/websockets
BSD 3-Clause "New" or "Revised" License
407 stars 114 forks source link

sendDataMessages raises Exception "writev: invalid argument (Invalid argument)" if passed an empty list #168

Closed OlivierSohn closed 6 years ago

OlivierSohn commented 6 years ago

When passing an empty list of DataMessage to sendDataMessages, the exception writev: invalid argument (Invalid argument) is received.

Maybe it's worth saying in the doc that the list should not be empty, or test in the implementation if it is empty, and do nothing in that case? I'm not sure what's best here.

jaspervdj commented 6 years ago

Makes sense, thanks for reporting! Fixed in https://github.com/jaspervdj/websockets/commit/a27bc04550346036573d30a93fd6530ea28561ff