VmSocketAddress

public final class VmSocketAddress
extends SocketAddress

java.lang.Object
   ↳ 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.

See also:

Summary

Public constructors

VmSocketAddress(int svmPort, int svmCid)

Creates a new instance of VmSocketAddress.

Public methods

int getSvmCid()

Returns the value of the svmCid field

int getSvmPort()

Returns the value of the svmPort field

Inherited methods

Public constructors

VmSocketAddress

Added in API level 33
public VmSocketAddress (int svmPort, 
                int svmCid)

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
public int getSvmCid ()

Returns the value of the svmCid field

Returns
int

getSvmPort

Added in API level 33
public int getSvmPort ()

Returns the value of the svmPort field

Returns
int