---
title: VZVirtioSocketDevice
framework: virtualization
role: symbol
role_heading: Class
path: virtualization/vzvirtiosocketdevice
---

# VZVirtioSocketDevice

A device that manages port-based connections between the guest system and the host computer.

## Declaration

```swift
class VZVirtioSocketDevice
```

## Overview

Overview Use a VZVirtioSocketDevice object to configure services and other communication end points in your virtual machine. Host computers make services available using ports, which identify the type of service and the protocol to use when transmitting data. Use this object to specify the ports available to your guest operating system, and to register handlers to manage the communication on those ports. Don’t create a VZVirtioSocketDevice object directly. Instead, when you request a socket device in your configuration, the virtual machine creates it and stores it in the socketDevices property. For each port you want to make available in your virtual machine, call the setSocketListener(_:forPort:) method and provide an object to manage the port connections.

## Topics

### Configuring Port Listeners

- [setSocketListener(_:forPort:)](virtualization/vzvirtiosocketdevice/setsocketlistener(_:forport:).md)
- [removeSocketListener(forPort:)](virtualization/vzvirtiosocketdevice/removesocketlistener(forport:).md)

### Connecting to Guest System Ports

- [connect(toPort:completionHandler:)](virtualization/vzvirtiosocketdevice/connect(toport:completionhandler:).md)
- [connect(toPort:)](virtualization/vzvirtiosocketdevice/connect(toport:).md)

## Relationships

### Inherits From

- [VZSocketDevice](virtualization/vzsocketdevice.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Devices

- [VZSocketDevice](virtualization/vzsocketdevice.md)
