Skip to content

How to connect custom Callbacks to specific Events from Server #650

@tmarasco125

Description

@tmarasco125

Hi there!

I have the SocketIOClient example running on my ESP32 and I can connect to my server. Using the SocketIOEvent function and switch case from that example I can log a list of event handlers and data coming from my server upon connection, but my question now is how to attach unique, custom callbacks to run when my ESP client receives events? Can the .onEvent() method from the SocketIOclient class take both an event name and a callback function as arguments? Or, would I build a nested switch case inside of the one provided in the example where I'm scanning the incoming Event/Data string from the server and execute functions based on the handler name/incoming data?

Thank you in advance for clarifying!

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