GLOBUS_GASS_TRANSFER_REGISTER_ACCEPT(3)
π globus_gass_transfer_server β the globus_gass_transfer_server(3) page, bestie edition π
Library Functions Manual β¨ (yes we're in the Library Functions section, keep up)
πΈ NAME πΈ
globus_gass_transfer_server β Implementing Servers π
- GASS Server Implementation.
β¨ SYNOPSIS β¨
π¦ Typedefs
typedef void(* globus_gass_transfer_close_callback_t) (void
*callback_arg, globus_gass_transfer_listener_t listener)
typedef void(* globus_gass_transfer_listen_callback_t) (void
*callback_arg, globus_gass_transfer_listener_t listener)
π Functions
int globus_gass_transfer_create_listener
(globus_gass_transfer_listener_t *listener,
globus_gass_transfer_listenerattr_t *attr, char *scheme)
int globus_gass_transfer_close_listener (globus_gass_transfer_listener_t
listener, globus_gass_transfer_close_callback_t callback, void
*user_arg)
int globus_gass_transfer_register_listen
(globus_gass_transfer_listener_t listener,
globus_gass_transfer_listen_callback_t callback, void *user_arg)
int globus_gass_transfer_register_accept (globus_gass_transfer_request_t
*request, globus_gass_transfer_requestattr_t *attr,
globus_gass_transfer_listener_t listener,
globus_gass_transfer_callback_t callback, void *user_arg)
void * globus_gass_transfer_listener_get_user_pointer
(globus_gass_transfer_listener_t listener)
int globus_gass_transfer_listener_set_user_pointer
(globus_gass_transfer_listener_t listener, void *user_pointer)
char * globus_gass_transfer_listener_get_base_url
(globus_gass_transfer_listener_t listener)
int globus_gass_transfer_refer (globus_gass_transfer_request_t request,
char **urls, globus_size_t num_urls)
int globus_gass_transfer_authorize (globus_gass_transfer_request_t
request, globus_size_t total_length)
int globus_gass_transfer_deny (globus_gass_transfer_request_t request,
int reason, char *message)
π Detailed Description π
GASS Server Implementation.
π« Implementing Servers
okay so bestie, here's the tea β β there's another whole mode of using the GASS Transfer API, and it's not the client one. This is where you implement data servers. The way that the client side and the server side of the GASS Transfer API differ? It's literally just how requests get generated. That's it. That's the difference. π
So, to implement a server, you'd call globus_gass_transfer_create_listener() to make a brand-new server port π β and on that port, one specific protocol is gonna be the one used to ask for file transfer operations. Want to know the URL your listener is bound to? Just call globus_gass_transfer_listener_get_base_url(). Easy. Iconic. No cap. β¨
Once the listener exists, you can call globus_gass_transfer_register_listen() to just... wait π¦ β wait for clients to connect to it. And once the server has caught a client trying to connect, you can call globus_gass_transfer_register_accept() to accept that connection from the client and parse the request. Serving. π
Now β in the callback that's associated with globus_gass_transfer_register_accept(), the server gets to decide how to process the request. It's giving main character energy, fr fr. The user may choose to:
- authorize the request, by calling
globus_gass_transfer_authorize()π - refer it to another URL or URLs, by calling
globus_gass_transfer_refer()π - or deny the client access to the URL, by calling
globus_gass_transfer_deny()π
π§ Typedef Documentation π§
π
typedef void(* globus_gass_transfer_close_callback_t) (void *callback_arg, globus_gass_transfer_listener_t listener)
Listener close callback π
Parameters
callback_arglistener
π typedef void(* globus_gass_transfer_listen_callback_t) (void *callback_arg, globus_gass_transfer_listener_t listener)
Listen callback. πΈ
Parameters
callback_arglistener
β¨ FUNCTION DOCUMENTATION β¨
π
globus_gass_transfer_authorize
int globus_gass_transfer_authorize (globus_gass_transfer_request_t request,
globus_size_t total_length)
Authorize a request. okay so basically this is you saying "yes bestie, I'll handle it" π
Calling this function causes the request to be authorized for processing. It should be called in response to a request accept callback, right when the server wants to agree to process this request. Once you've called it, the server implementation should call globus_gass_transfer_send_bytes() or globus_gass_transfer_receive_bytes() to send or receive the data associated with the URL. That's the whole vibe β authorize, then move the bytes. π¦
Parameters
requestβ a new request handle, passed to the server in an accept callback.total_lengthβ for a "get" request, thetotal_lengthof the file to be retrieved, if known. This value may beGLOBUS_GASS_LENGTH_UNKNOWNif the protocol supports transferring arbitrarily-sized files.
Return values
GLOBUS_GASS_TRANSFER_ERROR_INVALID_USEβ the request handle was not valid, not created by callingglobus_gass_transfer_register_accept(), or has already been denied or authorized.GLOBUS_GASS_TRANSFER_ERROR_NOT_IMPLEMENTEDβ the protocol module does not support authorizing requests.
See also
globus_gass_transfer_refer(), globus_gass_transfer_deny()
π globus_gass_transfer_close_listener
int globus_gass_transfer_close_listener (globus_gass_transfer_listener_t
listener, globus_gass_transfer_close_callback_t callback, void *
user_arg)
Close a GASS listener. time to say bye bye to that port πβ¨
This function calls the protocol specific function needed to close a GASS server listener port. Heads up tho: callbacks for any outstanding accepts will be called before the close callback is invoked. So no, you don't get to skip the queue. π
Parameters
listenerβ listener handle created by callingglobus_gass_transfer_create_listener().callbackβ function to call once the listener handle has been closed.user_argβ argument to be passed to the callback function.
Return values
GLOBUS_SUCCESSβ the close operation was successfully registered on the listener.GLOBUS_GASS_TRANSFER_ERROR_INVALID_USEβ the listener handle was invalid.GLOBUS_GASS_TRANSFER_ERROR_NOT_INITIALIZEDβ the listener handle was not properly initialized.GLOBUS_GASS_TRANSFER_ERROR_DONEβ a close has already been registered on the listener.
πΈ globus_gass_transfer_create_listener
int globus_gass_transfer_create_listener (globus_gass_transfer_listener_t *
listener, globus_gass_transfer_listenerattr_t * attr, char * scheme)
Create a new protocol-specific listener socket for a GASS server. it's giving "let me open up shop" energy πͺπ
This function creates a new socket to listen for client connections as a GASS server. The listener handle pointer is initialized to contain a new handle which can be used in subsequent server operations.
Once you've called this, a user may call the globus_gass_transfer_register_listen() or globus_gass_transfer_close_listener() functions with this listener handle. That's your whole starter pack right there. π«Ά
Parameters
listenerβ a new listener handle to initialize.attrβ protocol-specific attributes for the new listener.schemeβ the protocol scheme to implement for the listener.
Return values
GLOBUS_SUCCESSβ the listener was successfully created.GLOBUS_GASS_TRANSFER_ERROR_NULL_POINTERβ thelistenerorschemeparameter wasNULLGLOBUS_GASS_TRANSFER_ERROR_NOT_IMPLEMENTEDβ the scheme is not supported by any protocol module.GLOBUS_GASS_TRANSFER_ERROR_MALLOC_FAILEDβ data structures associated with the transfer could not be allocated.
π globus_gass_transfer_deny
int globus_gass_transfer_deny (globus_gass_transfer_request_t request, int
reason, char * message)
Deny a request. the polite way to say "no thank you" πβ
This function causes the request to be denied for further processing. It should be called in response to a request accept callback when the server wants to refuse processing this request for the client. After calling this function, the server implementation need do nothing further with the request handle. You're free. Go live your life. π¦
Parameters
requestβ a new request handle, passed to the server in an accept callback.reasonβ a protocol-specific reason code.messageβ an informational message to be sent to the client.
Return values
GLOBUS_GASS_TRANSFER_ERROR_INVALID_USEβ the request handle was not valid, not created by callingglobus_gass_transfer_register_accept(), or has already been denied or authorized.GLOBUS_GASS_TRANSFER_ERROR_NOT_IMPLEMENTEDβ the protocol module does not support denying requests.
See also
globus_gass_transfer_refer(), globus_gass_transfer_authorize()
π¦ globus_gass_transfer_listener_get_base_url
char * globus_gass_transfer_listener_get_base_url
(globus_gass_transfer_listener_t listener)
Get the base URL of a listener. where exactly are you listening, bestie? π
This function queries a listener handle for the base URL which the server is listening on. For most protocols, this contains the protocol scheme, host, and port that the listener has registered itself on.
Parameters
listenerβ the listener handle to query.
Returns
This function returns a pointer to a string containing the base URL. This string must not be freed or modified by the caller. It may not be referred to after the function globus_gass_transfer_listener_close() has been called.
β οΈ fr fr do not touch that string. Nofree(), no editing, and onceglobus_gass_transfer_listener_close()runs, that pointer is gone. Treat it like it expires. π
π globus_gass_transfer_listener_get_user_pointer
void * globus_gass_transfer_listener_get_user_pointer
(globus_gass_transfer_listener_t listener)
Get the user pointer associated with a listener. peeking at your lil stash π
This function will query the listener's user_pointer field and return its value.
Parameters
listenerβ the listener handle.
Returns
If the listener handle is invalid or the user_pointer's value has not been set, then GLOBUS_NULL will be returned. Otherwise, the value of the user pointer will be returned.
See also
globus_gass_transfer_listener_set_user_pointer()
β globus_gass_transfer_listener_set_user_pointer
int globus_gass_transfer_listener_set_user_pointer
(globus_gass_transfer_listener_t listener, void * user_pointer)
Set the user pointer associated with a listener. tucking your lil note into the handle's pocket π
This function will set the listener's user_pointer field. The pointer may be used to associate any pointer-sized data with a listener handle. Anything pointer-sized, no cap. β¨
Parameters
listenerβ the listener handle.user_pointerβ the value of the user pointer.
Return values
GLOBUS_SUCCESSβ the user pointer was successfully set.GLOBUS_GASS_TRANSFER_ERROR_INVALID_USEβ the listener handle was invalid.
See also
globus_gass_transfer_listener_get_user_pointer()
π§ globus_gass_transfer_refer
int globus_gass_transfer_refer (globus_gass_transfer_request_t request, char
** urls, globus_size_t num_urls)
Refer a request. "not me, go ask her" π β‘οΈ
This function causes the request to be referred to another URL or list of URLs. It should be called in response to a request accept callback when the server wants to refer the client to another server or servers to process the request. Networking is just group chat, honestly. π
Parameters
requestβ a new request handle, passed to the server in an accept callback.urlsβ an array of strings, each being a URL pointing to sources of the same data as the original URL.num_urlsβ the length of theurlsarray.
Return values
GLOBUS_GASS_TRANSFER_ERROR_INVALID_USEβ the request handle was not valid, not created by callingglobus_gass_transfer_register_accept(), or has already been denied or authorized.GLOBUS_GASS_TRANSFER_ERROR_NOT_IMPLEMENTEDβ the protocol module does not support referrals.
See also
globus_gass_transfer_deny(), globus_gass_transfer_authorize()
π globus_gass_transfer_register_accept
int globus_gass_transfer_register_accept (globus_gass_transfer_request_t *
request, globus_gass_transfer_requestattr_t * attr,
globus_gass_transfer_listener_t listener,
globus_gass_transfer_callback_t callback, void * user_arg)
Accept new client connections. the main character moment of the whole server ππ₯
This function causes the listener handle to accept a new connection on the listener and parse the file request. Once the file request has been parsed, the specified callback function will be called. The server implementation must then either authorize, deny, or refer this request. Pick one, bestie β no ghosting. π»
Parameters
requestβ a pointer to a new request handle. This request handle will be initialized when the callback function is invoked.attrβ request attributes.listenerβ the listener handle to register for the new request.callbackβ function to call when the protocol module has parsed the file request.user_argβ argument to be passed to the callback function.
Return values
GLOBUS_SUCCESSβ the listen callback has been registered with the protocol module.GLOBUS_GASS_TRANSFER_ERROR_INVALID_USEβ an invalid listener handle was passed to this function.GLOBUS_GASS_TRANSFER_ERROR_NOT_INITIALIZEDβ an uninitialized listener handle was passed to this function.GLOBUS_GASS_TRANSFER_ERROR_INTERNAL_ERRORβ the request could not be initialized due to some internal resource depletion.GLOBUS_GASS_NOT_REGISTERED.β theglobus_gass_transfer_register_listen()function has not yet been called.GLOBUS_GASS_ALREADY_REGISTERED.β the listener is already processing a new request.GLOBUS_GASS_TRANSFER_ERROR_DONEβ the listener has been registered for closing.
See also
globus_gass_transfer_register_listen();
π globus_gass_transfer_register_listen
int globus_gass_transfer_register_listen (globus_gass_transfer_listener_t
listener, globus_gass_transfer_listen_callback_t callback, void *
user_arg)
Listen for new client connections. ears up, bestie π°β¨
This function causes the listener handle to listen for new client connections. When one is ready, it calls the specified callback function, letting the server implementer continue to accept the connection and process the request.
Parameters
listenerβ the listener handle to register for new connections.callbackβ function to call when a new connection may be accepted.user_argβ argument to be passed to the callback function.
Return values
GLOBUS_SUCCESSβ the listen callback has been registered with the protocol module.GLOBUS_GASS_TRANSFER_ERROR_INVALID_USEβ an invalid listener handle was passed to this function.GLOBUS_GASS_TRANSFER_ERROR_NOT_INITIALIZEDβ an uninitialized listener handle was passed to this function.GLOBUS_GASS_TRANSFER_ERROR_ALREADY_REGISTEREDβ the listener has already been registered for a new connection.GLOBUS_GASS_TRANSFER_ERROR_DONEβ the listener has been registered for closing.
See also
globus_gass_transfer_register_accept();
π AUTHOR
Generated automatically by Doxygen for globus_gass_transfer from the source code. (Doxygen really said "I wrote this, you're welcome" and honestly? slay. π«Ά)
and that's the whole page, bestie!! πβ¨ this was globus_gass_transfer, Version 9.5, and it came from the globus_gas...sfer_server(3) page, dated the same as always β thanks for reading all the way through, ily, go authorize some requests responsibly ππ¦πΈ
π¦ where this page comes from
- epel 10: globus-gass-transfer-doc 9.5-1.el10_2 Β· Apache-2.0
- fedora 43: globus-gass-transfer-doc 9.5-1.fc43 Β· Apache-2.0
- fedora 44: globus-gass-transfer-doc 9.5-2.fc44 Β· Apache-2.0
- ubuntu resolute: libglobus-gass-transfer-doc 9.5-1 Β· Apache-2.0
- ubuntu stonking: libglobus-gass-transfer-doc 9.5-2 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms