CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
talk.h
Go to the documentation of this file.
1 
5 #ifndef CVMFS_TALK_H_
6 #define CVMFS_TALK_H_
7 
8 #include <pthread.h>
9 #include <unistd.h>
10 
11 #include <string>
12 #include <vector>
13 
14 #include "util/single_copy.h"
15 
16 namespace download {
17 class DownloadManager;
18 }
19 class FileSystem;
20 class FuseRemounter;
21 class MountPoint;
22 class OptionsManager;
23 
24 
30  public:
31  static TalkManager *Create(const std::string &socket_path,
32  MountPoint *mount_point,
33  FuseRemounter *remounter);
34  ~TalkManager();
35 
36  void Spawn();
37 
38  private:
42  static const unsigned kMaxCommandSize = 512;
43 
44  TalkManager(const std::string &socket_path,
45  MountPoint *mount_point,
46  FuseRemounter *remounter);
47  static void *MainResponder(void *data);
48  void Answer(int con_fd, const std::string &msg);
49  void AnswerStringList(int con_fd, const std::vector<std::string> &list);
50  std::string FormatMetalinkInfo(download::DownloadManager *download_mgr);
51  std::string FormatHostInfo(download::DownloadManager *download_mgr);
52  std::string FormatProxyInfo(download::DownloadManager *download_mgr);
53  std::string FormatLatencies(const MountPoint &mount_point,
54  FileSystem *file_system);
55 
56  std::string socket_path_;
60  pthread_t thread_talk_;
61  bool spawned_;
62 };
63 
64 #endif // CVMFS_TALK_H_
MountPoint * mount_point_
Definition: talk.h:58
FuseRemounter * remounter_
Definition: talk.h:59
std::string FormatProxyInfo(download::DownloadManager *download_mgr)
Definition: talk.cc:145
std::string FormatLatencies(const MountPoint &mount_point, FileSystem *file_system)
Definition: talk.cc:806
int socket_fd_
Definition: talk.h:57
std::string FormatMetalinkInfo(download::DownloadManager *download_mgr)
Definition: talk.cc:100
bool spawned_
Definition: talk.h:61
static TalkManager * Create(const std::string &socket_path, MountPoint *mount_point, FuseRemounter *remounter)
Definition: talk.cc:79
void Answer(int con_fd, const std::string &msg)
Definition: talk.cc:65
pthread_t thread_talk_
Definition: talk.h:60
TalkManager(const std::string &socket_path, MountPoint *mount_point, FuseRemounter *remounter)
Definition: talk.cc:890
std::string socket_path_
Definition: talk.h:56
std::string FormatHostInfo(download::DownloadManager *download_mgr)
Definition: talk.cc:118
static void * MainResponder(void *data)
Definition: talk.cc:178
~TalkManager()
Definition: talk.cc:904
void AnswerStringList(int con_fd, const std::vector< std::string > &list)
Definition: talk.cc:70
void Spawn()
Definition: talk.cc:926
static const unsigned kMaxCommandSize
Definition: talk.h:42