Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 1.2 KB

sip.js.transport.connect.md

File metadata and controls

31 lines (20 loc) · 1.2 KB

Home > sip.js > Transport > connect

Transport.connect() method

Connect to network.

Signature:

connect(): Promise<void>;

Returns:

Promise<void>

Remarks

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

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