目录

CLASS info
public abstract class ConnectCallback
Represents the callback listener class called during connection.

Public Constructor Summary

Constructor
public ConnectCallback()
Creates a ConnectCallback object.

Public Method Summary

Return typeMethod name
abstract voidonEstablish(String endpointId, ConnectInfo connectInfo)
Called back when a connection has been established and both ends need to confirm whether to accept the connection.
abstract voidonResult(String endpointId, ConnectResult result)
Called back when either end accepts or rejects the connection.
abstract void
onDisconnected
(String endpointId)
Called back when the remote endpoint disconnects or the connection is unreachable.

Public Constructors

Constructor
public ConnectCallback()
Creates a ConnectCallback object.

Public Methods

Method
public abstract void onEstablish(String endpointId, ConnectInfo connectInfo)
Called back when a connection has been established and both ends need to confirm whether to accept the connection.

Parameters

Parameter nameParameter desc
endpointIdID of the remote endpoint.
connectInfoConnection information.
Method
public abstract void onResult(String endpointId, ConnectResult result)
Called back when either end accepts or rejects the connection.

Parameters

Parameter nameParameter desc
endpointIdID of the remote endpoint.
resultIndicates whether the remote point accepts or rejects the connection. You can call the getStatus() method of the ConnectResult class to obtain the result code STATUS_SUCCESS or STATUS_CONNECT_REJECTED.
Method
public abstract void onDisconnected(String endpointId)
Called back when the remote endpoint disconnects or the connection is unreachable.

Parameters

Parameter nameParameter desc
endpointIdID of the remote endpoint.