@Override
public void run() {
try {
if (singleBuffer.remaining() > 2) {
final int code = singleBuffer.getShort();
session.close(new javax.websocket.CloseReason(javax.websocket.CloseReason.CloseCodes.getCloseCode(code), new UTF8Output(singleBuffer).extract()));
} else {
session.close();
}
} catch (IOException e) {
invokeOnError(e);