public void run() {
WebSockets.sendClose(toSend, channel, null);
try {
if (singleBuffer.remaining() > 1) {
final CloseReason.CloseCode code = CloseReason.CloseCodes.getCloseCode(singleBuffer.getShort());
final String reasonPhrase = singleBuffer.remaining() > 1 ? new UTF8Output(singleBuffer).extract() : null;
session.close(new CloseReason(code, reasonPhrase));
} else {
session.close();
}
} catch (IOException e) {