~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/mysql_unix_socket_protocol/protocol.cc

Merge Andrew - First part of admin client blueprint. Add max-connections per-protocol 

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
 
52
52
static bool clobber= false;
53
53
 
 
54
ProtocolCounters *Protocol::mysql_unix_counters= new ProtocolCounters();
 
55
 
54
56
Protocol::~Protocol()
55
57
{
56
58
  fs::remove(_unix_socket_path);
68
70
  fs::path uds_path(vm["path"].as<fs::path>());
69
71
  if (not fs::exists(uds_path))
70
72
  {
71
 
    context.add(new Protocol("mysql_unix_socket_protocol",
 
73
    Protocol *listen_obj= new Protocol("mysql_unix_socket_protocol",
72
74
                             true,
73
 
                             uds_path));
 
75
                             uds_path);
 
76
    context.add(listen_obj);
74
77
    context.registerVariable(new sys_var_const_string_val("path", fs::system_complete(uds_path).file_string()));
75
78
    context.registerVariable(new sys_var_bool_ptr_readonly("clobber", &clobber));
 
79
    context.registerVariable(new sys_var_uint32_t_ptr("max-connections", &Protocol::mysql_unix_counters->max_connections));
76
80
  }
77
81
  else
78
82
  {
155
159
          N_("Path used for MySQL UNIX Socket Protocol."));
156
160
  context("clobber",
157
161
          N_("Clobber socket file if one is there already."));
158
 
 
 
162
  context("max-connections",
 
163
          po::value<uint32_t>(&Protocol::mysql_unix_counters->max_connections)->default_value(1000),
 
164
          N_("Maximum simultaneous connections."));
159
165
}
160
166
 
161
167
} /* namespace mysql_unix_socket_protocol */