<!--
{
  "availability" : [
    "macOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Virtualization",
  "identifier" : "/documentation/Virtualization/VZVirtioSocketConnection/sourcePort",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Virtualization"
    ],
    "preciseIdentifier" : "c:objc(cs)VZVirtioSocketConnection(py)sourcePort"
  },
  "title" : "sourcePort"
}
-->

# sourcePort

The port number of the system that opened the connection.

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

## 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`](/documentation/Virtualization/VZVirtioSocketDevice) object, this property contains a randomly generated port number.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)