Skip to content
Snippets Groups Projects
Commit 5258347b authored by Michael Davis's avatar Michael Davis
Browse files

[xrd_ssi] Changes constructor to use one parameter for endpoint

Previously took hostname and port as separate parameters, but they are
provided together in the config file so no point in separating them just
to recombine them.
parent 7d6f3e28
No related branches found
No related tags found
No related merge requests found
......@@ -279,11 +279,10 @@ int exceptionThrowingMain(int argc, const char *const *const argv)
// Obtain a Service Provider
std::string host("localhost");
int port = 10956;
std::string endpoint("localhost:10956");
std::string resource("/ctafrontend");
XrdSsiPbServiceType cta_service(host, port, resource);
XrdSsiPbServiceType cta_service(endpoint, resource);
// Send the Request to the Service and get a Response
......
......@@ -28,7 +28,6 @@
/*!
* XrdSsiProviderClient is instantiated and managed by the SSI library
*/
extern XrdSsiProvider *XrdSsiProviderClient;
......@@ -45,14 +44,11 @@ const unsigned int DefaultServerTimeout = 15; //!< Maximum XRootD r
/*!
* Convenience object to manage the XRootD SSI service on the client side
*/
template <typename RequestType, typename MetadataType, typename AlertType>
class ServiceClientSide
{
public:
ServiceClientSide() = delete;
ServiceClientSide(const std::string &hostname, unsigned int port, const std::string &resource,
ServiceClientSide(const std::string &endpoint, const std::string &resource,
unsigned int response_bufsize = DefaultResponseBufferSize,
unsigned int server_tmo = DefaultServerTimeout);
......@@ -76,12 +72,10 @@ private:
/*!
* Client-side Service Constructor
*/
template <typename RequestType, typename MetadataType, typename AlertType>
ServiceClientSide<RequestType, MetadataType, AlertType>::
ServiceClientSide(const std::string &hostname, unsigned int port, const std::string &resource,
unsigned int response_bufsize,
unsigned int server_tmo) :
ServiceClientSide(const std::string &endpoint, const std::string &resource,
unsigned int response_bufsize, unsigned int server_tmo) :
m_resource(resource),
m_response_bufsize(response_bufsize),
m_server_tmo(server_tmo)
......@@ -112,7 +106,7 @@ ServiceClientSide(const std::string &hostname, unsigned int port, const std::str
// Get the Service pointer
if(!(m_server_ptr = XrdSsiProviderClient->GetService(eInfo, hostname + ":" + std::to_string(port))))
if(!(m_server_ptr = XrdSsiProviderClient->GetService(eInfo, endpoint)))
{
throw XrdSsiException(eInfo);
}
......@@ -123,7 +117,6 @@ ServiceClientSide(const std::string &hostname, unsigned int port, const std::str
/*!
* Client-side Service Destructor
*/
template <typename RequestType, typename MetadataType, typename AlertType>
ServiceClientSide<RequestType, MetadataType, AlertType>::~ServiceClientSide()
{
......@@ -146,7 +139,6 @@ ServiceClientSide<RequestType, MetadataType, AlertType>::~ServiceClientSide()
/*!
* Send a Request to the Service
*/
template <typename RequestType, typename MetadataType, typename AlertType>
MetadataType ServiceClientSide<RequestType, MetadataType, AlertType>::Send(const RequestType &request)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment