openmixer — generated API reference
    Preparing search index...

    A bound UDP socket that reports the sender, and sends to any peer.

    open() rejects if the bind fails — EADDRINUSE on a port somebody else holds is a startup failure a caller must see, not a warning it can run past into a surface that will never receive anything.

    Index
    • get isOpen(): boolean

      Whether the socket is bound.

      Returns boolean

    • get port(): number

      The port actually bound — the configured one, unless it was 0, in which case the OS chose.

      0 before the bind completes. Binding 0 is how a test gets a real socket without racing another test for a fixed number, and it is the only reason a caller cannot simply read back what it configured.

      Returns number

    • Close the socket and drop the reference. Idempotent.

      Returns Promise<void>

    • Bind the socket. Idempotent: a second call on an open endpoint does nothing.

      Parameters

      Returns Promise<void>

    • Send one datagram to one peer. Resolves once the OS accepts it — fire and forget, because a UDP control plane does not ACK and a caller that awaited delivery would be waiting on something that never arrives.

      Parameters

      Returns Promise<void>

    • Register a transport-level error handler.

      Post-bind UDP errors are noise a control plane survives — the ICMP port-unreachable a peer that went away generates arrives here, once per datagram sent to it. A caller that logs every one of them will drown; a caller that ignores them is fine.

      Parameters

      • handler: (err: Error) => void

      Returns void