private void validateStatusLine(StatusLine statusLine, Map<String, List<String>> headers, WebSocketInputStream input) throws WebSocketException
    {
        // If the status code is 101 (Switching Protocols).
        if (statusLine.getStatusCode() == 101)
        {
            // OK. The server can speak the WebSocket protocol.
            return;
        }

        // Read the response body.
        byte[] body = readBody(headers, input);

        // The status code of the opening handshake response is not Switching Protocols.
        throw new OpeningHandshakeException(
            WebSocketError.NOT_SWITCHING_PROTOCOLS,
            "The status code of the opening handshake response is not '101 Switching Protocols'. The status line is: " + statusLine,
            statusLine, headers, body);
    }
private void validateStatusLine ( StatusLine statusLine , Map < String , List < String > > headers , WebSocketInputStream input ) throws WebSocketException { if ( statusLine . getStatusCode ( ) == 101 ) { return ; } byte [ ] body = readBody ( headers , input ) ; throw new OpeningHandshakeException ( WebSocketError . NOT_SWITCHING_PROTOCOLS , "The status code of the opening handshake response is not '101 Switching Protocols'. The status line is: " + statusLine , statusLine , headers , body ) ; }
Validate the status line. {@code "101 Switching Protocols"} is expected.