<!--
{
  "availability" : [
    "macOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Virtualization",
  "identifier" : "/documentation/Virtualization/VZVirtioSocketDevice/removeSocketListener(forPort:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Virtualization"
    ],
    "preciseIdentifier" : "c:objc(cs)VZVirtioSocketDevice(im)removeSocketListenerForPort:"
  },
  "title" : "removeSocketListener(forPort:)"
}
-->

# removeSocketListener(forPort:)

Removes the listener object from the specfied port.

```
func removeSocketListener(forPort port: UInt32)
```

## Parameters

`port`

The port number to clear. If the specified port doesn’t have a listener object, this method does nothing.

---

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)