Added in API level 29
Callback
open class Callback
| kotlin.Any | |
| ↳ | android.net.SocketKeepalive.Callback |
The callback which app can use to learn the status changes of SocketKeepalive. See SocketKeepalive.
Summary
| Public constructors | |
|---|---|
Callback() |
|
| Public methods | |
|---|---|
| open Unit |
The keepalive on a TCP socket was stopped because the socket received data. |
| open Unit |
An error occurred. |
| open Unit |
The requested keepalive was successfully started. |
| open Unit |
The keepalive was successfully stopped. |
Public constructors
Public methods
onDataReceived
Added in API level 29
open fun onDataReceived(): Unit
The keepalive on a TCP socket was stopped because the socket received data. This is never called for UDP sockets.
onError
Added in API level 29
open fun onError(error: Int): Unit
An error occurred.
| Parameters | |
|---|---|
error |
Int: Value is android.net.SocketKeepalive#ERROR_INVALID_NETWORK, android.net.SocketKeepalive#ERROR_INVALID_IP_ADDRESS, android.net.SocketKeepalive#ERROR_INVALID_PORT, android.net.SocketKeepalive#ERROR_INVALID_LENGTH, android.net.SocketKeepalive#ERROR_INVALID_INTERVAL, android.net.SocketKeepalive#ERROR_INVALID_SOCKET, android.net.SocketKeepalive#ERROR_SOCKET_NOT_IDLE, or android.net.SocketKeepalive.ERROR_NO_SUCH_SLOT |
onStarted
Added in API level 29
open fun onStarted(): Unit
The requested keepalive was successfully started.