---
title: VZVirtioSocketListener
framework: virtualization
role: symbol
role_heading: Class
path: virtualization/vzvirtiosocketlistener
---

# VZVirtioSocketListener

An object that listens for port-based connection requests from the guest operating system.

## Declaration

```swift
class VZVirtioSocketListener
```

## Overview

Overview Use a VZVirtioSocketListener object to route connection requests to your associated delegate object. The socket listener object handles incoming connection requests from the guest operating system and directs them to the methods of its associated delegate object. You may use the same listener object to monitor connections on multiple ports. After creating a VZVirtioSocketListener object, assign a custom object to its delegate property. The delegate must implement the VZVirtioSocketListenerDelegate protocol. To connect the listener to a port, call the setSocketListener(_:forPort:) method of your virtual machine’s VZVirtioSocketDevice object.

## Topics

### Responding to new connections

- [delegate](virtualization/vzvirtiosocketlistener/delegate.md)
- [VZVirtioSocketListenerDelegate](virtualization/vzvirtiosocketlistenerdelegate.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.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

### Connection management

- [VZVirtioSocketConnection](virtualization/vzvirtiosocketconnection.md)
