}
return;
case CLOSE:
delegateListener.closeFrameReceived = true;
final CloseReason reason;
// we asume at least the status code is in the first frame which should be ok
if (buffers[0].hasRemaining()) {
int code = buffers[0].getShort();
String text;
if (StreamSinkChannelUtils.payloadLength(buffers) > 0) {
text = WebSocketUtils.toUtf8String(buffers);
} else {
text = null;
}
reason = new CloseReason(code, text);
} else {
reason = null;
}
if (session.executeInIoThread) {
handler.onCloseFrame(session, reason);