Skip to content

Bugfix for Example: The HTTP request to initiate the WebSocket connection to [wss://ws.bitvavo.com/v2/] failed #14

@atienkamp

Description

@atienkamp

The example tests werent working for websockets.
setting the buffer size fixed this issue:

    public WebsocketClientEndpoint(URI endpointURI, Bitvavo bitv) {
        try {
            bitvavo = bitv;
            WebSocketContainer container = ContainerProvider.getWebSocketContainer();
            container.setDefaultMaxBinaryMessageBufferSize(1024*1024);
            container.setDefaultMaxTextMessageBufferSize(1024*1024);
            container.connectToServer(this, endpointURI);
        } catch (Exception e) {
            e.printStackTrace();
            bitvavo.errorToConsole("Caught exception in instantiating websocket." + e);
            this.reconnectTimer = 100;
            retryConnecting(endpointURI);
        }
    }

container.connectToServer(this, endpointURI);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions