현재 연결 상태를 즉시 반환하고, 필요하면 heartbeat 타이머를 재가동합니다.
반환값은 내부 ws.readyState 기반입니다. 연결이 OPEN 이면 true,
그 외(연결 시도 중 / 종료 중 / 종료됨 / 미연결)에는 false 입니다.
추가로, 연결이 OPEN 인데 SDK 내부 heartbeat 타이머가 동작 중이 아니면 타이머를 다시 시작합니다. 모바일에서 백그라운드 진입 시 JS 타이머가 정지/스로틀되어 ping 사이클이 멈춘 경우, 포그라운드 복귀(AppState→active) 직후 이 메서드를 호출하면 연결 상태를 확인하면서 동시에 heartbeat 감지를 즉시 재가동할 수 있습니다.
connect({ heartbeat: false })) 경우에는 타이머를
시작하지 않고 상태만 반환합니다.연결이 OPEN 상태면 true, 그 외에는 false
Establishes a WebSocket connection to the specified URL.
Connection arguments
Optionalheartbeat?: false | HeartbeatOptionsHeartbeat 설정. false로 설정하면 heartbeat 비활성화
Closes the WebSocket connection.
Registers a callback function to be called when the WebSocket connection is established.
Callback registration arguments
Function to be called on successful connection
Registers a callback function to be called when the WebSocket connection is closed.
Callback registration arguments
Function to be called when connection is closed
Registers a callback function to handle incoming messages.
Updates the heartbeat ping interval at runtime.
적용 동작:
connect({ heartbeat: false }) 로
비활성화된 경우에는 호출이 무시됩니다.새로운 ping 전송 주기 (밀리초). 양수여야 합니다.
Subscribes to a specific topic with authentication token.
Subscription arguments
Authentication token for the subscription
The topic to subscribe to
Unsubscribes from a previously subscribed topic.
Unsubscription arguments
The topic to unsubscribe from
WebSocket client interface for handling real-time communication with the server. Provides methods for connection management, topic subscription, and event handling.