toWrite -= thisWrite.intValue();
}
// Same size as the WsFrame input buffer
response = ByteBuffer.allocate(maxBinaryMessageBufferSize);
HandshakeResponse handshakeResponse =
processResponse(response, channel, timeout);
clientEndpointConfiguration.getConfigurator().
afterResponse(handshakeResponse);
// Sub-protocol
// Header names are always stored in lower case
List<String> values = handshakeResponse.getHeaders().get(
Constants.WS_PROTOCOL_HEADER_NAME_LOWER);
if (values == null || values.size() == 0) {
subProtocol = null;
} else if (values.size() == 1) {
subProtocol = values.get(0);