00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #pragma once
00023
00024 #include <drizzled/plugin/listen_tcp.h>
00025 #include <drizzled/plugin/client.h>
00026 #include <drizzled/atomics.h>
00027 #include <drizzled/plugin/table_function.h>
00028 #include <boost/filesystem.hpp>
00029 #include <plugin/mysql_protocol/mysql_protocol.h>
00030
00031 namespace drizzle_plugin {
00032 namespace mysql_unix_socket_protocol {
00033
00034 class Protocol : public ListenMySQLProtocol
00035 {
00036 public:
00037 Protocol(std::string name, const boost::filesystem::path &unix_socket_path) :
00038 ListenMySQLProtocol(name, unix_socket_path.file_string()),
00039 _unix_socket_path(unix_socket_path)
00040 { }
00041
00042 ~Protocol();
00043 bool getFileDescriptors(std::vector<int> &fds);
00044
00045 in_port_t getPort(void) const;
00046 static ProtocolCounters mysql_unix_counters;
00047 virtual ProtocolCounters& getCounters() const {return mysql_unix_counters; }
00048 drizzled::plugin::Client *getClient(int fd);
00049 private:
00050 const boost::filesystem::path _unix_socket_path;
00051 };
00052
00053 }
00054 }
00055