Skip to content

Does the order of event handlers matter? #26

@CMCDragonkai

Description

@CMCDragonkai

I'm writing a http connect forwarding proxy. And we have to handle the connect event.

This library associated a connection event that will eventually either destroy the socket, or handle a close event on the sockets.

Does it matter in what order the event handlers are added?

Furthermore if my event handler, is asynchronous, and awaits for various operations, such as establishing a connection to the target server, then it's possible that the socket created here is left dangling, or even the client socket is destroyed, while I attempt to write to it later.

How do I handle the problem where stop is run, while in the middle of an asynchronous request handler, do we just allow these exceptions to be thrown?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions