I wrote this method:
def failSocket() {
interfaces.webSocket.close()
interfaces.webSocket.sendMessage(new JsonOutput().toJson([ event: "ping"]))
}
Given that on the line before I have obviously closed the socket, the send has to fail. But no matter how many times I call failSocket() no exception is thrown, webSocketStatus is not called, I can't find any way to know that the sendMessage failed and I need to reconnect.
Am I doing something wrong? Or is this a bug/limitation? I'm REALLY struggling to figure out how to reliably detect when I've been disconnected from a websocket.