---
title: sourcePort
framework: virtualization
role: symbol
role_heading: Instance Property
path: virtualization/vzvirtiosocketconnection/sourceport
---

# sourcePort

The port number of the system that opened the connection.

## Declaration

```swift
var sourcePort: UInt32 { get }
```

## Discussion

Discussion When the guest operating system opens a connection, this property contains the port number that the guest specified. When you open a connection to the guest operating system from your VZVirtioSocketDevice object, this property contains a randomly generated port number.

## See Also

### Getting the connection details

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