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

# OBEXSessionSetServerCallback

```
OBEXError OBEXSessionSetServerCallback(OBEXSessionRef inSessionRef, OBEXSessionEventCallback inCallback, void *inUserRefCon);
```

## Parameters

`inSessionRef`

A valid session reference.

`inCallback`

A valid callback. Will be called for progress, errors and completion by server sessions only.

`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

Sets callback to be used when an event occurs on an OBEXSession. This is important for OBEX servers, as you will need a way to be called back when the first command is sent to you. So, be sure to set yourself up to listen for events when you are ready to receive them.

*** 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)