Added in API level 33

VmSocketAddress


class VmSocketAddress : SocketAddress
kotlin.Any
   ↳ java.net.SocketAddress
   ↳ android.system.VmSocketAddress

A virtio-vsock address VmSocketAddress.

virtio-vsock socket address, linux specific.

VmSocketAddress corresponds to struct sockaddr_vm in bionic/libc/kernel/uapi/linux/vm_sockets.h.

Currently virtio-vsock is used as a generic purpose pipe in emulators to talk to the host. Most I/O operations using this address via Os class will require additional permissions to talk to the host.

Summary

Public constructors
VmSocketAddress(svmPort: Int, svmCid: Int)

Creates a new instance of VmSocketAddress.

Public methods
Int

Returns the value of the svmCid field

Int

Returns the value of the svmPort field

Public constructors

VmSocketAddress

Added in API level 33
VmSocketAddress(
    svmPort: Int,
    svmCid: Int)

Creates a new instance of VmSocketAddress.

Parameters
svmPort Int: The svmPort field value, see OsConstants#VMADDR_PORT_ANY.
svmCid Int: The svmCid field value, see OsConstants.VMADDR_CID_* for VMADDR_CID_* values.

Public methods

getSvmCid

Added in API level 33
fun getSvmCid(): Int

Returns the value of the svmCid field

getSvmPort

Added in API level 33
fun getSvmPort(): Int

Returns the value of the svmPort field