Class WebSocketClientProtocolHandler

    • Constructor Detail

      • WebSocketClientProtocolHandler

        public WebSocketClientProtocolHandler​(WebSocketClientProtocolConfig clientConfig)
        Base constructor
        Parameters:
        clientConfig - Client protocol configuration.
      • WebSocketClientProtocolHandler

        public WebSocketClientProtocolHandler​(java.net.URI webSocketURL,
                                              WebSocketVersion version,
                                              java.lang.String subprotocol,
                                              boolean allowExtensions,
                                              HttpHeaders customHeaders,
                                              int maxFramePayloadLength,
                                              boolean handleCloseFrames,
                                              boolean performMasking,
                                              boolean allowMaskMismatch)
        Base constructor
        Parameters:
        webSocketURL - URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be sent to this URL.
        version - Version of web socket specification to use to connect to the server
        subprotocol - Sub protocol request sent to the server.
        customHeaders - Map of custom headers to add to the client request
        maxFramePayloadLength - Maximum length of a frame's payload
        handleCloseFrames - true if close frames should not be forwarded and just close the channel
        performMasking - Whether to mask all written websocket frames. This must be set to true in order to be fully compatible with the websocket specifications. Client applications that communicate with a non-standard server which doesn't require masking might set this to false to achieve a higher performance.
        allowMaskMismatch - When set to true, frames which are not masked properly according to the standard will still be accepted.
      • WebSocketClientProtocolHandler

        public WebSocketClientProtocolHandler​(java.net.URI webSocketURL,
                                              WebSocketVersion version,
                                              java.lang.String subprotocol,
                                              boolean allowExtensions,
                                              HttpHeaders customHeaders,
                                              int maxFramePayloadLength,
                                              boolean handleCloseFrames,
                                              boolean performMasking,
                                              boolean allowMaskMismatch,
                                              long handshakeTimeoutMillis)
        Base constructor
        Parameters:
        webSocketURL - URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be sent to this URL.
        version - Version of web socket specification to use to connect to the server
        subprotocol - Sub protocol request sent to the server.
        customHeaders - Map of custom headers to add to the client request
        maxFramePayloadLength - Maximum length of a frame's payload
        handleCloseFrames - true if close frames should not be forwarded and just close the channel
        performMasking - Whether to mask all written websocket frames. This must be set to true in order to be fully compatible with the websocket specifications. Client applications that communicate with a non-standard server which doesn't require masking might set this to false to achieve a higher performance.
        allowMaskMismatch - When set to true, frames which are not masked properly according to the standard will still be accepted.
        handshakeTimeoutMillis - Handshake timeout in mills, when handshake timeout, will trigger user event WebSocketClientProtocolHandler.ClientHandshakeStateEvent.HANDSHAKE_TIMEOUT
      • WebSocketClientProtocolHandler

        public WebSocketClientProtocolHandler​(java.net.URI webSocketURL,
                                              WebSocketVersion version,
                                              java.lang.String subprotocol,
                                              boolean allowExtensions,
                                              HttpHeaders customHeaders,
                                              int maxFramePayloadLength,
                                              boolean handleCloseFrames)
        Base constructor
        Parameters:
        webSocketURL - URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be sent to this URL.
        version - Version of web socket specification to use to connect to the server
        subprotocol - Sub protocol request sent to the server.
        customHeaders - Map of custom headers to add to the client request
        maxFramePayloadLength - Maximum length of a frame's payload
        handleCloseFrames - true if close frames should not be forwarded and just close the channel
      • WebSocketClientProtocolHandler

        public WebSocketClientProtocolHandler​(java.net.URI webSocketURL,
                                              WebSocketVersion version,
                                              java.lang.String subprotocol,
                                              boolean allowExtensions,
                                              HttpHeaders customHeaders,
                                              int maxFramePayloadLength,
                                              boolean handleCloseFrames,
                                              long handshakeTimeoutMillis)
        Base constructor
        Parameters:
        webSocketURL - URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be sent to this URL.
        version - Version of web socket specification to use to connect to the server
        subprotocol - Sub protocol request sent to the server.
        customHeaders - Map of custom headers to add to the client request
        maxFramePayloadLength - Maximum length of a frame's payload
        handleCloseFrames - true if close frames should not be forwarded and just close the channel
        handshakeTimeoutMillis - Handshake timeout in mills, when handshake timeout, will trigger user event WebSocketClientProtocolHandler.ClientHandshakeStateEvent.HANDSHAKE_TIMEOUT
      • WebSocketClientProtocolHandler

        public WebSocketClientProtocolHandler​(java.net.URI webSocketURL,
                                              WebSocketVersion version,
                                              java.lang.String subprotocol,
                                              boolean allowExtensions,
                                              HttpHeaders customHeaders,
                                              int maxFramePayloadLength)
        Base constructor
        Parameters:
        webSocketURL - URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be sent to this URL.
        version - Version of web socket specification to use to connect to the server
        subprotocol - Sub protocol request sent to the server.
        customHeaders - Map of custom headers to add to the client request
        maxFramePayloadLength - Maximum length of a frame's payload
      • WebSocketClientProtocolHandler

        public WebSocketClientProtocolHandler​(java.net.URI webSocketURL,
                                              WebSocketVersion version,
                                              java.lang.String subprotocol,
                                              boolean allowExtensions,
                                              HttpHeaders customHeaders,
                                              int maxFramePayloadLength,
                                              long handshakeTimeoutMillis)
        Base constructor
        Parameters:
        webSocketURL - URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be sent to this URL.
        version - Version of web socket specification to use to connect to the server
        subprotocol - Sub protocol request sent to the server.
        customHeaders - Map of custom headers to add to the client request
        maxFramePayloadLength - Maximum length of a frame's payload
        handshakeTimeoutMillis - Handshake timeout in mills, when handshake timeout, will trigger user event WebSocketClientProtocolHandler.ClientHandshakeStateEvent.HANDSHAKE_TIMEOUT
      • WebSocketClientProtocolHandler

        public WebSocketClientProtocolHandler​(WebSocketClientHandshaker handshaker,
                                              boolean handleCloseFrames)
        Base constructor
        Parameters:
        handshaker - The WebSocketClientHandshaker which will be used to issue the handshake once the connection was established to the remote peer.
        handleCloseFrames - true if close frames should not be forwarded and just close the channel
      • WebSocketClientProtocolHandler

        public WebSocketClientProtocolHandler​(WebSocketClientHandshaker handshaker,
                                              boolean handleCloseFrames,
                                              boolean dropPongFrames)
        Base constructor
        Parameters:
        handshaker - The WebSocketClientHandshaker which will be used to issue the handshake once the connection was established to the remote peer.
        handleCloseFrames - true if close frames should not be forwarded and just close the channel
        dropPongFrames - true if pong frames should not be forwarded
      • WebSocketClientProtocolHandler

        public WebSocketClientProtocolHandler​(WebSocketClientHandshaker handshaker,
                                              boolean handleCloseFrames,
                                              boolean dropPongFrames,
                                              long handshakeTimeoutMillis)
        Base constructor
        Parameters:
        handshaker - The WebSocketClientHandshaker which will be used to issue the handshake once the connection was established to the remote peer.
        handleCloseFrames - true if close frames should not be forwarded and just close the channel
        dropPongFrames - true if pong frames should not be forwarded
        handshakeTimeoutMillis - Handshake timeout in mills, when handshake timeout, will trigger user event WebSocketClientProtocolHandler.ClientHandshakeStateEvent.HANDSHAKE_TIMEOUT
      • WebSocketClientProtocolHandler

        public WebSocketClientProtocolHandler​(WebSocketClientHandshaker handshaker,
                                              boolean handleCloseFrames,
                                              boolean dropPongFrames,
                                              long handshakeTimeoutMillis,
                                              boolean withUTF8Validator)
        Base constructor
        Parameters:
        handshaker - The WebSocketClientHandshaker which will be used to issue the handshake once the connection was established to the remote peer.
        handleCloseFrames - true if close frames should not be forwarded and just close the channel
        dropPongFrames - true if pong frames should not be forwarded
        handshakeTimeoutMillis - Handshake timeout in mills, when handshake timeout, will trigger user event WebSocketClientProtocolHandler.ClientHandshakeStateEvent.HANDSHAKE_TIMEOUT
        withUTF8Validator - true if UTF8 validation of text frames should be enabled
      • WebSocketClientProtocolHandler

        public WebSocketClientProtocolHandler​(WebSocketClientHandshaker handshaker)
        Base constructor
        Parameters:
        handshaker - The WebSocketClientHandshaker which will be used to issue the handshake once the connection was established to the remote peer.