globus_gass_transfer_server(3) | globus_gass_transfer | globus_gass_transfer_server(3) |
globus_gass_transfer_server - Implementing Servers
- GASS Server Implementation.
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)
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)
GASS Server Implementation.
Implementing Servers
Another mode of using the GASS Transfer API is to implement data servers. The primary difference between the client and server parts of the GASS Transfer API are how requests are generated.
To implement a server, the user would call globus_gass_transfer_create_listener() to create a new server port on which a specific protocol will be used to request file transfer operations. The user may obtain the URL that the listener is bound to by calling globus_gass_transfer_listener_get_base_url().
Once the listener is created, the user can call globus_gass_transfer_register_listen() to wait for clients to connect to it. Once the server has detected an attempt to connect by a client, the use can call globus_gass_transfer_register_accept() to accept the connection from the client and parse the request.
In the callback associated with globus_gass_transfer_register_accept(), the server can decide how to process the request. 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().
Listener close callback
Parameters
Listen callback.
Parameters
Authorize a request.
This function causes the request to be authorized for processing. It should be called in response to a request accept callback when the server wants to agree to process this request. After calling this function, 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.
Parameters
Return values
See also
Close a GASS listener.
This function calls the protocol specific function needed to close a GASS server listener port. Callbacks for any outstanding accepts will be called before the close callback is invoked.
Parameters
Return values
Create a new protocol-specific listener socket for a GASS server.
This function creates a new socket to listen for client connections as a GASS server. The listener handle pointer is initialized to contain the a new handle which can be used in subsequent server operations.
After calling this function, a user may call the globus_gass_transfer_register_listen() or globus_gass_transfer_close_listener() functions with this listener handle.
Parameters
Return values
Deny a request.
This function causes the request to be denied for further processing. It should be called in response to a request ccept 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.
Parameters
Return values
See also
Get the base URL of a listener.
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
Returns
Get the user pointer associated with a listener.
This function will query the listener's user_pointer field and return it's value.
Parameters
Returns
See also
Set the user pointer associated with a listener.
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.
Parameters
Return values
See also
Refer a request.
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.
Parameters
Return values
See also
Accept new client connections.
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.
Parameters
Return values
See also
Listen for new client connections.
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
Return values
See also
Generated automatically by Doxygen for globus_gass_transfer from the source code.
Tue Jul 5 2022 | Version 9.4 |