---
title: SetDataQueue
framework: networkingdriverkit
role: symbol
role_heading: Instance Method
path: networkingdriverkit/iousernetworkpacketqueue/setdataqueue
---

# SetDataQueue

Assigns the specified dispatch source to this object.

## Declaration

```occ
kern_return_t SetDataQueue(IODataQueueDispatchSource *dataQueue);
```

## Parameters

- `dataQueue`: The new data queue to use when executing tasks.

## Return Value

Return Value kIOReturnSuccess on success, or another value if an error occurred.

## Discussion

Discussion Use this method to change the dispatch queue that this object uses to perform tasks. This method releases the previous dispatch queue, if any, and retains the new object in the dataQueue parameter.

## See Also

### Managing the Data Queue

- [CopyDataQueue](networkingdriverkit/iousernetworkpacketqueue/copydataqueue.md)
