| CLASS info |
| public abstract class ConnectCallback |
| Represents the callback listener class called during connection. |
| Constructor |
| public ConnectCallback() Creates a ConnectCallback object. |
| Return type | Method name |
| 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. |
| abstract void | onResult(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. |
| Constructor |
| public ConnectCallback() |
| Creates a ConnectCallback object. |
| 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 name | Parameter desc |
| endpointId | ID of the remote endpoint. |
| connectInfo | Connection information. |
| Method |
| public abstract void onResult(String endpointId, ConnectResult result) |
| Called back when either end accepts or rejects the connection. |
Parameters
| Parameter name | Parameter desc |
| endpointId | ID of the remote endpoint. |
| result | Indicates 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 name | Parameter desc |
| endpointId | ID of the remote endpoint. |