<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "IOBluetooth",
  "identifier" : "/documentation/IOBluetooth/OBEXSession/openTransportConnection(_:selectorTarget:refCon:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "IOBluetooth"
    ],
    "preciseIdentifier" : "c:objc(cs)OBEXSession(im)openTransportConnection:selectorTarget:refCon:"
  },
  "title" : "openTransportConnection(_:selectorTarget:refCon:)"
}
-->

# openTransportConnection(_:selectorTarget:refCon:)

Opens a transport connection to a device. A Bluetooth connection is one example of a transport.

```
func openTransportConnection(_ inSelector: Selector!, selectorTarget inTarget: Any!, refCon inUserRefCon: UnsafeMutableRawPointer!) -> OBEXError
```

## Parameters

`inSelector`

Selector to call for success, failure or timeout.

`inTarget`

Target on which to call the selector.

`inUserRefCon`

Caller’s reference constant.

## Discussion

Tranport subclasses must override this! when called you should attempt to open your transport connection, and if you are successful, return kOBEXSuccess, otherwise an interesting error code.

---

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)