Skip to content

Give the main WebSocketClient thread and AbstractWebSocket Timer a name #666

@cjgriscom

Description

@cjgriscom

Only the read thread is assigned a name in a WebSocketClient instance. The main Runnable acquires a default name like "Thread-7". I'm working on an application where I need to identify threads and manage them, and it would be nice to be able to distinguish them purely by name instead of inspecting their stack trace.

According to oakkitten who it pointed out in this thread, the connect() method creates a writeThread field which is overwritten with a new WebsocketWriteThread when the thread runs. WebsocketWriteThread sets the name, but the thread started in the connect() method continues to run with the default name.

Additionally oakkitten noted that a new Timer is created in AbstractWebSocket and it also lacks a name.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions