Skip to content

RPC hang forever if do not add custom message handler #218

@7sDream

Description

@7sDream

If script.handle_message is not called, script.exports.call will hang indefinitely.

From the source code, this is because RPC calls use the same IPC channel as send, and the entire IPC message handler is registered only when a custom handler is set via handle_message. Therefore, without setting a custom handler, the call method can't receive RPC responses and just waiting forever.

I am not certain whether the current API design intentionally works this way, but I find it somewhat counterintuitive.

I performed a comparative test using the Python binding: in Python, RPC calls work normally even without calling script.on("message", on_message).

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