Skip to content

unable to close websocket #4378

@hugomrdias

Description

@hugomrdias

Check existing issues

Viem Version

2.46.3

Current Behavior

if (client.transport.type === 'webSocket') {
  const websocket: ReturnType<WebSocketTransport>['value'] =
    client.transport

  const rpcClient = await websocket.getRpcClient()
  rpcClient.close()
}

it just reconnects and never closes and the node process never exits

Expected Behavior

actually close the socket with reconnecting

Steps To Reproduce

No response

Link to Minimal Reproducible Example

No response

Anything else?

Never closes, to be able to close properly you need to init with keepAlive: false and reconnect: false.

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