|
xrootd
|
#include <Server.hh>

Public Types | |
| typedef std::map< std::string, std::pair< uint64_t, uint32_t > > | TransferMap |
Public Member Functions | |
| Server () | |
| Constructor. More... | |
| ~Server () | |
| Destructor. More... | |
| bool | Setup (int port, int accept, ClientHandlerFactory *factory) |
| bool | Start () |
| Start the server. More... | |
| bool | Stop () |
| std::pair< uint64_t, uint32_t > | GetSentStats (const std::string host) const |
| Get the statisctics of the sent data. More... | |
| std::pair< uint64_t, uint32_t > | GetReceivedStats (const std::string host) const |
| Get the stats of the received data. More... | |
| int | HandleConnections () |
| Handle clients. More... | |
Private Attributes | |
| TransferMap | pSent |
| TransferMap | pReceived |
| pthread_t | pServerThread |
| std::vector< ClientHelper * > | pClients |
| int | pListenSocket |
| ClientHandlerFactory * | pHandlerFactory |
Server emulator.
| typedef std::map<std::string, std::pair<uint64_t, uint32_t> > XrdClTests::Server::TransferMap |
| XrdClTests::Server::Server | ( | ) |
Constructor.
| XrdClTests::Server::~Server | ( | ) |
Destructor.
References close(), pHandlerFactory, and pListenSocket.
| std::pair< uint64_t, uint32_t > XrdClTests::Server::GetReceivedStats | ( | const std::string | host | ) | const |
Get the stats of the received data.
References pReceived.
| std::pair< uint64_t, uint32_t > XrdClTests::Server::GetSentStats | ( | const std::string | host | ) | const |
| int XrdClTests::Server::HandleConnections | ( | ) |
Handle clients.
References close(), XrdClTests::ClientHandlerFactory::CreateHandler(), XrdCl::Log::Debug(), XrdCl::Log::Error(), XrdClTests::TestEnv::GetLog(), HandleClient(), XrdClTests::ClientHelper::handler, XrdSysDNS::IPFormat(), XrdClTests::ClientHelper::name, pClients, pHandlerFactory, pListenSocket, pReceived, pSent, XrdClTests::ClientHelper::socket, and XrdClTests::ClientHelper::thread.
Referenced by HandleConnections(), and Start().
| bool XrdClTests::Server::Setup | ( | int | port, |
| int | accept, | ||
| ClientHandlerFactory * | factory | ||
| ) |
Listen for incomming connections and handle clients
| port | port to listen on |
| accept | number of clients to accept |
| factory | client handler factory, the server takes ownership of this object |
References XrdCl::Log::Debug(), XrdCl::Log::Error(), XrdClTests::TestEnv::GetLog(), pClients, pHandlerFactory, and pListenSocket.
Referenced by PollerTest::FunctionTest().
| bool XrdClTests::Server::Start | ( | void | ) |
Start the server.
References XrdCl::Log::Debug(), XrdCl::Log::Error(), XrdClTests::TestEnv::GetLog(), HandleConnections(), and pServerThread.
Referenced by PollerTest::FunctionTest().
| bool XrdClTests::Server::Stop | ( | ) |
Wait for the server to finish - it blocks until all the clients have been handled
References XrdCl::Log::Debug(), XrdCl::Log::Error(), XrdClTests::TestEnv::GetLog(), and pServerThread.
Referenced by PollerTest::FunctionTest().
|
private |
Referenced by HandleConnections(), and Setup().
|
private |
Referenced by HandleConnections(), Setup(), and ~Server().
|
private |
Referenced by HandleConnections(), Setup(), and ~Server().
|
private |
Referenced by GetReceivedStats(), and HandleConnections().
|
private |
Referenced by GetSentStats(), and HandleConnections().
1.8.3.1