Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/system/VmSocketAddress#pubctors) \| [Methods](https://developer.android.com/reference/android/system/VmSocketAddress#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/system/VmSocketAddress#inhmethods)

# VmSocketAddress

*** ** * ** ***

` public final class VmSocketAddress `   
` ` ` extends https://developer.android.com/reference/java/net/SocketAddress ` ` `

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||
| ↳ | [java.net.SocketAddress](https://developer.android.com/reference/java/net/SocketAddress) ||
|   | ↳ | android.system.VmSocketAddress |

<br />

*** ** * ** ***

A virtio-vsock address `https://developer.android.com/reference/android/system/VmSocketAddress`.

virtio-vsock socket address, linux specific.

`https://developer.android.com/reference/android/system/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 `https://developer.android.com/reference/android/system/Os` class will require additional permissions to talk to the host.
**See also:**

- [vsock(7)](https://man7.org/linux/man-pages/man7/vsock.7.html)

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/system/VmSocketAddress#VmSocketAddress(int,%20int)(int svmPort, int svmCid) ` Creates a new instance of VmSocketAddress. |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/system/VmSocketAddress#getSvmCid()() ` Returns the value of the svmCid field |
| ` int` | ` https://developer.android.com/reference/android/system/VmSocketAddress#getSvmPort()() ` Returns the value of the svmPort field |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public constructors

### VmSocketAddress

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public VmSocketAddress (int svmPort, 
                int svmCid)
```

Creates a new instance of VmSocketAddress.

<br />

| Parameters ||
|---|---|
| `svmPort` | `int`: The svmPort field value, see `https://developer.android.com/reference/android/system/OsConstants#VMADDR_PORT_ANY`. <br /> |
| `svmCid` | `int`: The svmCid field value, see OsConstants.VMADDR_CID_\* for VMADDR_CID_\* values. <br /> |

## Public methods

### getSvmCid

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getSvmCid ()
```

Returns the value of the svmCid field

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getSvmPort

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getSvmPort ()
```

Returns the value of the svmPort field

<br />

| Returns ||
|---|---|
| `int` | <br /> |