Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 1.23 KB

sip.js.transport.disconnect.md

File metadata and controls

31 lines (20 loc) · 1.23 KB

Home > sip.js > Transport > disconnect

Transport.disconnect() method

Disconnect from network.

Signature:

disconnect(): Promise<void>;

Returns:

Promise<void>

Remarks

- If `state` is "Connecting", `state` MUST transition to "Disconnecting" before returning.
- If `state` is "Connected", `state` MUST transition to "Disconnecting" before returning.
- If `state` is "Disconnecting", `state` MUST NOT transition before returning.
- If `state` is "Disconnected", `state` MUST NOT transition before returning.
- The `state` MUST transition to "Disconnected" before resolving (assuming `state` is not already "Disconnected").
- The `state` MUST transition to "Connecting" or "Connected" before rejecting and MUST reject with an Error.

Resolves when the transport disconnects. Rejects if transport fails to disconnect. Rejects with StateTransitionError if a loop is detected. In particular, callbacks and emitters MUST NOT call this method synchronously.