---
name: "globus_gass_transfer_data"
section: "3"
platform: "linux"
package: "libglobus-gass-transfer-doc"
version: "9.4-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/globus_gass_transfer_data"
---

# globus\_gass\_transfer\_data(3)

Sending and Receiving Data - Sending and Receiving Data.

## NAME

globus\_gass\_transfer\_data - Sending and Receiving Data

 \- Sending and Receiving Data.

## SYNOPSIS

### Typedefs

typedef void(\* **globus\_gass\_transfer\_bytes\_callback\_t**) (void \*arg, **globus\_gass\_transfer\_request\_t** request, globus\_byte\_t \*bytes, globus\_size\_t length, globus\_bool\_t last\_data)\

### Functions

int **globus\_gass\_transfer\_send\_bytes** (**globus\_gass\_transfer\_request\_t** request, globus\_byte\_t \*bytes, globus\_size\_t send\_length, globus\_bool\_t last\_data, **globus\_gass\_transfer\_bytes\_callback\_t** callback, void \*user\_arg)\
 int **globus\_gass\_transfer\_receive\_bytes** (**globus\_gass\_transfer\_request\_t** request, globus\_byte\_t \*bytes, globus\_size\_t max\_length, globus\_size\_t wait\_for\_length, **globus\_gass\_transfer\_bytes\_callback\_t** callback, void \*user\_arg)\

## Detailed Description

Sending and Receiving Data.

## Typedef Documentation

### typedef void(\* globus\_gass\_transfer\_bytes\_callback\_t) (void \*arg, globus\_gass\_transfer\_request\_t request, globus\_byte\_t \*bytes, globus\_size\_t length, globus\_bool\_t last\_data)

Byte send or receive callback function.

**Parameters**

*arg* The user\_arg passed to the function which registered this callback. The user may use this value for any purpose. \
 *request* The request handle associated with this byte array. \
 *bytes* The byte array which was sent or received. \
 *length* The length of data which was sent or received. \
 *last\_data* Boolean flag whether this is the final byte array for this request.

**See also**

**globus\_gass\_transfer\_send\_bytes()**, **globus\_gass\_transfer\_receive\_bytes()**

## Function Documentation

### int globus\_gass\_transfer\_receive\_bytes (globus\_gass\_transfer\_request\_t request, globus\_byte\_t \* bytes, globus\_size\_t max\_length, globus\_size\_t wait\_for\_length, globus\_gass\_transfer\_bytes\_callback\_t callback, void \* user\_arg)

Receive a byte array associated with a request handle.

This function receives a block of data from a server or client as part of the processing for a request. Multiple data blocks may be registered with the GASS transfer library at once.

When processing a server request, this function may only be used in conjunction with 'put' or 'append' requests. The user must call **globus\_gass\_transfer\_authorize()** before calling this function.

When processing a client request, this function may only be used in conjunction with 'get' requests. This function may not be called before either the callback function has been invoked, or the blocking globus\_gass\_tranfser\_put() or **globus\_gass\_transfer\_append()** function has returned.

**Parameters**

*request* The request handle with which this block of bytes is associated. \
 *bytes* A user-supplied buffer containing the data associated with the request. \
 *max\_length* The length of the *bytes* array. \
 *wait\_for\_length* The minimum amount of data to wait for before invoking the *callback* function. A partial byte array of at least this amount will be returned in the callback, unless end-of-file is reached before this amount. \
 *callback* Function to call once the *bytes* array has been received. \
 *user\_arg* Argument to be passed to the *callback* function.

**Return values**

*GLOBUS\_SUCCESS* The *bytes* array was successfully registered with the GASS transfer library. The *callback* function will be invoked once it has been received. \
 *GLOBUS\_GASS\_TRANSFER\_ERROR\_NULL\_POINTER* The *bytes* or *callback* parameter was NULL. \
 *GLOBUS\_GASS\_TRANSFER\_ERROR\_INVALID\_USER* The *request* was invalid, or it is not one on which bytes can be sent. \
 *GLOBUS\_GASS\_TRANSFER\_ERROR\_NOT\_INITIALIZED* The callback to a non-blocking file request has not been invoked yet, a blocking file request has not returned, or the request has not yet been authorized. \
 *GLOBUS\_GASS\_TRANSFER\_ERROR\_REQUEST\_FAILED* The *request* has failed by either the client, server, or protocol module implementation. \
 *GLOBUS\_GASS\_TRANSFER\_ERROR\_DONE* The *request* has already been completed.

### int globus\_gass\_transfer\_send\_bytes (globus\_gass\_transfer\_request\_t request, globus\_byte\_t \* bytes, globus\_size\_t send\_length, globus\_bool\_t last\_data, globus\_gass\_transfer\_bytes\_callback\_t callback, void \* user\_arg)

Send a byte array associated with a request handle.

This function sends a block of data to a server or client as part of the processing for a request. Multiple data blocks may be registered with the GASS transfer library at once.

When processing a server request, this function may only be used in conjunction with 'get' requests. The user must call **globus\_gass\_transfer\_authorize()** before calling this function.

When processing a client request, this function may only be used in conjunction with 'put' or 'append' requests. This function may not be called before either the callback function has been invoked, or the blocking globus\_gass\_tranfser\_put() or **globus\_gass\_transfer\_append()** function has returned.

**Parameters**

*request* The request handle with which this block of bytes is associated. \
 *bytes* A user-supplied buffer containing the data associated with the request. \
 *send\_length* The length of the *bytes* array. \
 *last\_data* A flag to indicate whether this is the final block of data for the request. If this is true, then the *callback* function will be delayed until the server acknowledges that the file has been completely received. \
 *callback* Function to call once the *bytes* array has been sent. \
 *user\_arg* Argument to be passed to the *callback* function.

**Return values**

*GLOBUS\_SUCCESS* The *bytes* array was successfully registered with the GASS transfer library. The *callback* function will be invoked once it has been sent. \
 *GLOBUS\_GASS\_TRANSFER\_ERROR\_NULL\_POINTER* The *bytes* or *callback* parameter was NULL. \
 *GLOBUS\_GASS\_TRANSFER\_ERROR\_INVALID\_USER* The *request* was invalid, or it is not one on which bytes can be sent. \
 *GLOBUS\_GASS\_TRANSFER\_ERROR\_NOT\_INITIALIZED* The callback to a non-blocking file request has not been invoked yet, a blocking file request has not returned, or the request has not yet been authorized. \
 *GLOBUS\_GASS\_TRANSFER\_ERROR\_REQUEST\_FAILED* The *request* has failed by either the client, server, or protocol module implementation. \
 *GLOBUS\_GASS\_TRANSFER\_ERROR\_DONE* The *request* has already been completed.

## Author

Generated automatically by Doxygen for globus\_gass\_transfer from the source code.
