fix send messages through websocket connection when the server is using kqueue