This code seems to assume a single socket (based on the usage of `add_callback`).  Is that true?