<!--
{
  "availability" : [
    "macOS: 10.0.0 - 10.6.0"
  ],
  "documentType" : "symbol",
  "framework" : "IOBluetooth",
  "identifier" : "/documentation/IOBluetooth/OBEXSessionAbort",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "IOBluetooth"
    ],
    "preciseIdentifier" : "c:@F@OBEXSessionAbort"
  },
  "title" : "OBEXSessionAbort"
}
-->

# OBEXSessionAbort

Send an abort command to a remote OBEX server.

```
OBEXError OBEXSessionAbort(OBEXSessionRef inSessionRef, void *inOptionalHeaders, size_t inOptionalHeadersLength, OBEXSessionEventCallback inCallback, void *inUserRefCon);
```

## Parameters

`inSessionRef`

A valid session reference.

`inOptionalHeaders`

Ptr to optional headers you can supply to the command. DO NOT dispose of this pointer until you callback is called with a success.

`inOptionalHeadersLength`

Size of data at the specified ptr.

`inCallback`

A valid callback. Will be called for progress, errors and completion.

`inUserRefCon`

Optional parameter; can contain anything you wish. Will be returned in your callback just as you passed it.

## Return Value

An error code value. 0 if successful.

## Discussion

As all commands for OBEX sessions, this command is asynchronous only. A NULL callback paramter will result in an error.

*** DEPRECATED IN BLUETOOTH 2.2 (OS X v10.6) *** You should transition your code to Objective-C equivalents. *** This API may be removed any time in the future.

---

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)