본문으로 건너뛰기
버전: SDK-5.11.8

Disconnect

public void Disconnect();

설명

실시간 알림 서버에 연결을 해제합니다.
앱 종료 시, 필수로 호출해야 합니다.

Example

//접속 해제 시 반응하는 핸들러를 설정.  
Backend.Notification.OnDisConnect = (string Reason) => {
Debug.Log("해제 이유 : " + Reason);
};

//실시간 알림 서버 접속을 해제한다
Backend.Notification.DisConnect();

OnDisConnect

public OnDisconnect OnDisConnect;

파라미터

ValueTypeDescription
Reasonstring연결 해제된 이유

설명

Disconncect 가 완료된 후 발생하는 이벤트의 핸들러입니다. Reason을 통해서 연결 해제의 원인이 반환됩니다.
또한, 비정상적으로 접속이 끊길 시, 해당 핸들러가 호출됩니다.

Example

Backend.Notification.OnDisConnect = (string Reason) => {
Debug.Log("실시간 알림 서버 접속이 해제되었습니다!");
Debug.Log("해제 이유 : " + Reason);
};

ReturnCase

Possible reasons:

ReasonSideDescription
transport errorServer SideTransport error
server namespace disconnectServer SideServer performs a socket.disconnect()
client namespace disconnectClient SideGot disconnect packet from client
ping timeoutClient SideClient stopped responding to pings in the allowed amount of time(per the pingTimeout config setting)
transport closeClient SideClient stopped sending data