---
title: VZVirtioSocketConnection
framework: virtualization
role: symbol
role_heading: Class
path: virtualization/vzvirtiosocketconnection
---

# VZVirtioSocketConnection

A port-based connection between the guest operating system and the host computer.

## Declaration

```swift
class VZVirtioSocketConnection
```

## Overview

Overview A VZVirtioSocketConnection object contains the port information for the guest operating system and host computer. You don’t create connection objects directly. When the guest operating system initiates a connection, the virtual machine creates the connection object and passes it to the appropriate VZVirtioSocketListener object, which forwards the object to its delegate. When the virtual machine opens a connection to a guest port, the connect(toPort:) method (Objective-C) or connect(toPort:completionHandler:) method (Swift) pass the connection object to your completion handler.

## Topics

### Getting the connection details

- [sourcePort](virtualization/vzvirtiosocketconnection/sourceport.md)
- [destinationPort](virtualization/vzvirtiosocketconnection/destinationport.md)
- [fileDescriptor](virtualization/vzvirtiosocketconnection/filedescriptor.md)

### Closing the connection

- [close()](virtualization/vzvirtiosocketconnection/close().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

- [VZVirtioSocketListener](virtualization/vzvirtiosocketlistener.md)
