Grid Community Toolkit  6.2.1705709074 (tag: v6.2.20240202)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Typedefs | Functions
Sending and Receiving Data

Sending and Receiving Data. More...

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
argThe user_arg passed to the function which registered this callback. The user may use this value for any purpose.
requestThe request handle associated with this byte array.
bytesThe byte array which was sent or received.
lengthThe length of data which was sent or received.
last_dataBoolean 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
requestThe request handle with which this block of bytes is associated.
bytesA user-supplied buffer containing the data associated with the request.
max_lengthThe length of the bytes array.
wait_for_lengthThe 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.
callbackFunction to call once the bytes array has been received.
user_argArgument to be passed to the callback function.
Return values
GLOBUS_SUCCESSThe 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_POINTERThe bytes or callback parameter was NULL.
GLOBUS_GASS_TRANSFER_ERROR_INVALID_USERThe request was invalid, or it is not one on which bytes can be sent.
GLOBUS_GASS_TRANSFER_ERROR_NOT_INITIALIZEDThe 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_FAILEDThe request has failed by either the client, server, or protocol module implementation.
GLOBUS_GASS_TRANSFER_ERROR_DONEThe 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
requestThe request handle with which this block of bytes is associated.
bytesA user-supplied buffer containing the data associated with the request.
send_lengthThe length of the bytes array.
last_dataA 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.
callbackFunction to call once the bytes array has been sent.
user_argArgument to be passed to the callback function.
Return values
GLOBUS_SUCCESSThe 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_POINTERThe bytes or callback parameter was NULL.
GLOBUS_GASS_TRANSFER_ERROR_INVALID_USERThe request was invalid, or it is not one on which bytes can be sent.
GLOBUS_GASS_TRANSFER_ERROR_NOT_INITIALIZEDThe 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_FAILEDThe request has failed by either the client, server, or protocol module implementation.
GLOBUS_GASS_TRANSFER_ERROR_DONEThe request has already been completed.