NCBI C++ ToolKit
nst_server.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: nst_server.cpp 86936 2019-07-10 13:39:06Z satskyse $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Denis Vakatov
27  *
28  * File Description: NetStorage threaded server
29  *
30  */
31 
32 #include <ncbi_pch.hpp>
34 
35 #include "nst_server.hpp"
36 #include "nst_service_thread.hpp"
37 #include "nst_config.hpp"
38 #include "nst_constants.hpp"
39 
40 
42 
43 
45 const string kCrashFlagFileName("CRASH_FLAG");
46 
47 
49  : m_Port(0),
50  m_HostNetAddr(CSocketAPI::gethostbyname(kEmptyStr)),
51  m_Shutdown(false),
52  m_SigNum(0),
53  m_Log(default_log),
54  m_LogTimingNSTAPI(default_log_timing_nst_api),
55  m_LogTimingClientSocket(default_log_timing_client_socket),
56  m_SessionID("s" + x_GenerateGUID()),
57  m_NetworkTimeout(0),
58  m_DataPath("./data." + NStr::NumericToString(m_Port)),
59  m_StartTime(CNSTPreciseTime::Current()),
60  m_AnybodyCanReconfigure(false),
61  m_NeedDecryptCacheReset(false),
62  m_LastDecryptCacheReset(0.0)
63 {
64  sm_netstorage_server = this;
65 }
66 
67 
69 {}
70 
71 
72 void
74 {
75  AddListener(factory, m_Port);
76 }
77 
78 
81  const SNetStorageServerParameters & params,
82  bool reconfigure)
83 {
84  if (!reconfigure) {
85  CServer::SetParameters(params);
86 
87  m_Port = params.port;
88  m_Log = params.log;
93  m_DataPath = params.data_path;
94  return CJsonNode::NewNullNode();
95  }
96 
97  // Here: it is reconfiguration.
98  // Need to consider:
99  // - log
100  // - admin names
101  // - max connections
102  // - network timeout
103 
104  set<string> new_admins = x_GetAdminClientNames(
105  params.admin_client_names);
106  vector<string> added;
107  vector<string> deleted;
108 
109  {
111 
112  // Compare the old and the new sets of administrators
113  set_difference(new_admins.begin(), new_admins.end(),
115  inserter(added, added.begin()));
116  set_difference(m_AdminClientNames.begin(), m_AdminClientNames.end(),
117  new_admins.begin(), new_admins.end(),
118  inserter(deleted, deleted.begin()));
119 
120  m_AdminClientNames = new_admins;
121  }
122 
123  SServer_Parameters current_params;
124  CServer::GetParameters(&current_params);
125 
126  if (m_Log == params.log &&
129  m_NetworkTimeout == params.network_timeout &&
130  m_DataPath == params.data_path &&
131  current_params.max_connections == params.max_connections &&
132  added.empty() &&
133  deleted.empty())
134  return CJsonNode::NewNullNode();
135 
136  // Here: there is a difference
138 
139  if (m_Log != params.log) {
141 
142  values.SetByKey("Old", CJsonNode::NewBooleanNode(m_Log));
143  values.SetByKey("New", CJsonNode::NewBooleanNode(params.log));
144  diff.SetByKey("log", values);
145 
146  m_Log = params.log;
147  }
148  if (m_LogTimingNSTAPI != params.log_timing_nst_api) {
150 
152  values.SetByKey("New", CJsonNode::NewBooleanNode(
153  params.log_timing_nst_api));
154  diff.SetByKey("log_timing_nst_api", values);
155 
157  }
160 
161  values.SetByKey("Old", CJsonNode::NewBooleanNode(
163  values.SetByKey("New", CJsonNode::NewBooleanNode(
164  params.log_timing_client_socket));
165  diff.SetByKey("log_timing_client_socket", values);
166 
168  }
169 
170  if (m_NetworkTimeout != params.network_timeout) {
172 
174  values.SetByKey("New", CJsonNode::NewIntegerNode(
175  params.network_timeout));
176  diff.SetByKey("network_timeout", values);
177 
179  }
180 
181  if (m_DataPath != params.data_path) {
183 
185  values.SetByKey("New", CJsonNode::NewStringNode(params.data_path));
186  diff.SetByKey("data_path", values);
187 
188  m_DataPath = params.data_path;
189  }
190 
191  if (current_params.max_connections != params.max_connections) {
193 
194  values.SetByKey("Old", CJsonNode::NewIntegerNode(
195  current_params.max_connections));
196  values.SetByKey("New", CJsonNode::NewIntegerNode(
197  params.max_connections));
198  diff.SetByKey("max_connections", values);
199 
200  current_params.max_connections = params.max_connections;
201  CServer::SetParameters(current_params);
202  }
203 
204  if (!added.empty() || !deleted.empty())
205  diff.SetByKey("admin_client_name", x_diffInJson(added, deleted));
206 
207  return diff;
208 }
209 
210 
212 {
213  return m_Shutdown;
214 }
215 
216 
218 {
219  if (!m_Shutdown) {
220  m_Shutdown = true;
221  m_SigNum = signum;
222  }
223 }
224 
225 
227 {
228  return sm_netstorage_server;
229 }
230 
231 
233 {}
234 
235 
236 // Resets the decrypt keys cache if necessary
238 {
239  const CNSTPreciseTime k_ResetInterval(100.0);
240 
243  if ((current - m_LastDecryptCacheReset) >= k_ResetInterval) {
245  m_LastDecryptCacheReset = current;
246  }
247  }
248 }
249 
250 
252  const string & message)
253 {
256 }
257 
258 
260 {
261  m_NeedDecryptCacheReset = false;
262 }
263 
264 
266 {
267  // Naive implementation of the unique identifier.
269  Int8 current_time = time(0);
270 
271  return NStr::NumericToString((pid << 32) | current_time);
272 }
273 
274 
275 void
277  vector<string> & config_warnings)
278 {
280  config_warnings);
281 }
282 
283 
284 CJsonNode
286 {
287  vector<string> added;
288  vector<string> deleted;
289  vector<string> common;
290  vector<string> changed;
291 
292  for (CJsonIterator it = m_BackendConfiguration.Iterate(); it; ++it) {
293  string key = it.GetKey();
294 
295  if (conf.HasKey(key))
296  common.push_back(key);
297  else
298  deleted.push_back(key);
299  }
300 
301  for (CJsonIterator it = conf.Iterate(); it; ++it) {
302  string key = it.GetKey();
303 
305  added.push_back(key);
306  }
307 
308  // We do not detect what specifically changed in the certain service
309  // configuration. We detect only the fact a certain service has changed.
310  for (vector<string>::const_iterator k = common.begin();
311  k != common.end(); ++k) {
312  string old_params = m_BackendConfiguration.GetByKey(*k).Repr();
313  string new_params = conf.GetByKey(*k).Repr();
314 
315  if (old_params != new_params)
316  changed.push_back(*k);
317  }
318 
319  // Test if any changes detected
320  if (added.empty() && deleted.empty() && changed.empty())
321  return CJsonNode::NewNullNode();
322 
323  // Here: need to build a dictionary with changes
325 
326  if (!added.empty()) {
327  CJsonNode added_services = CJsonNode::NewArrayNode();
328  for (vector<string>::const_iterator k = added.begin();
329  k != added.end(); ++k)
330  added_services.AppendString(*k);
331  diff.SetByKey("AddedServices", added_services);
332  }
333 
334  if (!deleted.empty()) {
335  CJsonNode deleted_services = CJsonNode::NewArrayNode();
336  for (vector<string>::const_iterator k = deleted.begin();
337  k != deleted.end(); ++k)
338  deleted_services.AppendString(*k);
339  diff.SetByKey("DeletedServices", deleted_services);
340  }
341 
342  if (!changed.empty()) {
343  CJsonNode changed_services = CJsonNode::NewArrayNode();
344  for (vector<string>::const_iterator k = changed.begin();
345  k != changed.end(); ++k)
346  changed_services.AppendString(*k);
347  diff.SetByKey("ChangedServices", changed_services);
348  }
349 
350  return diff;
351 }
352 
353 
354 bool CNetStorageServer::IsAdminClientName(const string & name) const
355 {
358 
359  found = m_AdminClientNames.find(name);
360  return found != m_AdminClientNames.end();
361 }
362 
363 
365 CNetStorageServer::x_GetAdminClientNames(const string & client_names)
366 {
367  vector<string> admins;
368  NStr::Split(client_names, ";, ", admins,
370  return set<string>(admins.begin(), admins.end());
371 }
372 
373 
375  const string & user)
376 {
377  return m_Alerts.Acknowledge(id, user);
378 }
379 
380 
382  const string & user)
383 {
384  return m_Alerts.Acknowledge(alert_type, user);
385 }
386 
387 
389  const string & message)
390 {
391  m_Alerts.Register(alert_type, message);
392 }
393 
394 
396 {
397  return m_Alerts.Serialize();
398 }
399 
400 
402 {
403  if (m_Db.get())
404  return *m_Db;
405 
406  m_Db.reset(new CNSTDatabase(this));
407  return *m_Db;
408 }
409 
410 
412 CNetStorageServer::InMetadataServices(const string & service) const
413 {
414  return m_MetadataServiceRegistry.IsKnown(service);
415 }
416 
417 
418 bool CNetStorageServer::GetServiceTTL(const string & service,
419  TNSTDBValue<CTimeSpan> & ttl) const
420 {
421  return m_MetadataServiceRegistry.GetTTL(service, ttl);
422 }
423 
424 
425 bool
427  const string & service,
428  const TNSTDBValue<Int8> & individual_obj_ttl,
429  TNSTDBValue<CTimeSpan> & prolong_on_read) const
430 {
432  service, individual_obj_ttl, prolong_on_read);
433 }
434 
435 
436 bool
438  const string & service,
439  const TNSTDBValue<Int8> & individual_obj_ttl,
440  TNSTDBValue<CTimeSpan> & prolong_on_write) const
441 {
443  service, individual_obj_ttl, prolong_on_write);
444 }
445 
446 
447 bool
449  CNSTServiceProperties & service_props) const
450 {
452  service_props);
453 }
454 
455 
456 CJsonNode
458 {
460 }
461 
462 
463 CJsonNode
465 {
467 }
468 
469 
470 void
472 {
474  m_ServiceThread->Run();
475 }
476 
477 
478 void
480 {
481  if (!m_ServiceThread.Empty()) {
485  }
486 }
487 
488 
489 CJsonNode
490 CNetStorageServer::x_diffInJson(const vector<string> & added,
491  const vector<string> & deleted) const
492 {
494 
495  if (!added.empty()) {
496  CJsonNode add_node = CJsonNode::NewArrayNode();
497  for (vector<string>::const_iterator k = added.begin();
498  k != added.end(); ++k)
499  add_node.AppendString(*k);
500  diff.SetByKey("Added", add_node);
501  }
502 
503  if (!deleted.empty()) {
504  CJsonNode del_node = CJsonNode::NewArrayNode();
505  for (vector<string>::const_iterator k = deleted.begin();
506  k != deleted.end(); ++k)
507  del_node.AppendString(*k);
508  diff.SetByKey("Deleted", del_node);
509  }
510 
511  return diff;
512 }
513 
514 
516 {
518 }
519 
520 
522 {
523  return CFile(x_GetCrashFlagFileName()).Exists();
524 }
525 
526 
528 {
529  if (x_DoesCrashFlagFileExist()) {
530  // There could be two reasons:
531  // - start after crash
532  // - previous instance could not remove the file by some reasons, e.g.
533  // due to changed permissions
535  "The server did not stop gracefully last time");
536 
537  // Try to remove the file to check the permissions and re-create it
538  string error = RemoveCrashFlagFile();
539  if (!error.empty()) {
540  ERR_POST(error);
542  return;
543  }
544 
546  if (!error.empty()) {
547  ERR_POST(error);
549  return;
550  }
551 
552  // Here: the crash flag file has been successfully re-created
553  return;
554  }
555 
556  // Here: the crash flag file does not exist.
557  // Check that the directory exists
558  bool dir_created = true;
559  if (!CDirEntry(m_DataPath).Exists()) {
560  string msg = "The data path directory " + m_DataPath +
561  " does not exist. It is OK if it is a first time "
562  "server start. Otherwise someone may have removed the "
563  "directory and this may mask the previous instance "
564  "crash";
566  ERR_POST(msg);
567 
568  // Create the directory recursively
569  try {
570  CDir dir(m_DataPath);
571  if (dir.CreatePath() == false) {
572  msg = "Error creating the data path directory " + m_DataPath;
574  ERR_POST(msg);
575  dir_created = false;
576  }
577  } catch (const exception & ex) {
578  msg = "Error while creating the data path directory (" +
579  m_DataPath + "): " + ex.what();
581  ERR_POST(msg);
582  dir_created = false;
583  } catch (...) {
584  msg = "Unknown error while creating the data path directory (" +
585  m_DataPath + ")";
587  ERR_POST(msg);
588  dir_created = false;
589  }
590  }
591 
592  // Create the flag file
593  if (dir_created) {
594  string error = CreateCrashFlagFile();
595  if (!error.empty()) {
596  ERR_POST(error);
598  }
599  }
600 }
601 
602 
604 {
605  try {
606  CFile crash_file(x_GetCrashFlagFileName());
607  if (!crash_file.Exists()) {
608  CFileIO f;
609  f.Open(x_GetCrashFlagFileName(),
612  f.Close();
613  }
614  } catch (const exception & ex) {
615  return "Error while creating the start-after-crash detection "
616  "file (" + x_GetCrashFlagFileName() + "): " + ex.what();
617  } catch (...) {
618  return "Unknown error while creating the start-after-crash "
619  "detection file (" + x_GetCrashFlagFileName() + ").";
620  }
621  return kEmptyStr;
622 }
623 
624 
626 {
627  try {
628  CFile crash_file(x_GetCrashFlagFileName());
629  if (crash_file.Exists())
630  crash_file.Remove();
631  } catch (const exception & ex) {
632  return "Error while removing the start-after-crash detection "
633  "file (" + x_GetCrashFlagFileName() + "): " + ex.what() +
634  "\nWhen the server restarts with the same data path it will "
635  "set the 'StartAfterCrash' alert";
636  } catch (...) {
637  return "Unknown error while removing the start-after-crash detection "
638  "file (" + x_GetCrashFlagFileName() + "). When the server "
639  "restarts with the same data path it will set the "
640  "'StartAfterCrash' alert";
641  }
642  return kEmptyStr;
643 }
644 
CDirEntry –.
Definition: ncbifile.hpp:262
CDir –.
Definition: ncbifile.hpp:1696
Class for support low level input/output for files.
Definition: ncbifile.hpp:3476
CFile –.
Definition: ncbifile.hpp:1605
Iterator for JSON arrays and objects.
JSON node abstraction.
static CJsonNode NewArrayNode()
Create a new JSON array node.
bool HasKey(const string &key) const
Check if an object node has an element accessible by the specified key.
string Repr(TReprFlags flags=0) const
Return a string representation of this node.
SJsonIteratorImpl * Iterate(EIterationMode mode=eNatural) const
For a container node (that is, either an array or an object), begin iteration over its elements.
void AppendString(const string &value)
For an array node, add a string node at the end of the array.
static CJsonNode NewBooleanNode(bool value)
Create a new JSON boolean node.
void SetByKey(const string &key, CJsonNode::TInstance value)
For a JSON object node, insert a new element or update an existing element.
static CJsonNode NewIntegerNode(Int8 value)
Create a new JSON integer node.
static CJsonNode NewStringNode(const string &value)
Create a new JSON string node.
static CJsonNode NewObjectNode()
Create a new JSON object node.
CJsonNode GetByKey(const string &key) const
For a JSON object node, return the value associated with the specified key.
static CJsonNode NewNullNode()
Create a new JSON null node.
enum EAlertAckResult Acknowledge(const string &alert_id, const string &user)
Definition: nst_alert.cpp:113
void Register(enum EAlertType alert_type, const string &message)
Definition: nst_alert.cpp:88
CJsonNode Serialize(void) const
Definition: nst_alert.cpp:166
static CNSTPreciseTime Current(void)
bool GetTTL(const string &service, TNSTDBValue< CTimeSpan > &ttl) const
bool GetProlongOnRead(const string &service, const TNSTDBValue< Int8 > &individual_obj_ttl, TNSTDBValue< CTimeSpan > &prolong_on_read) const
CJsonNode Serialize(void) const
bool GetServiceProperties(const string &service, CNSTServiceProperties &props) const
bool GetProlongOnWrite(const string &service, const TNSTDBValue< Int8 > &individual_obj_ttl, TNSTDBValue< CTimeSpan > &prolong_on_write) const
CJsonNode ReadConfiguration(const IRegistry &reg)
EServiceMetadataPresence IsKnown(const string &service) const
static void Reload(void)
Re-read key file locations and domain paths, reload encryption keys.
CNSTServiceRegistry m_MetadataServiceRegistry
Definition: nst_server.hpp:176
CJsonNode SetParameters(const SNetStorageServerParameters &new_params, bool reconfigure)
Definition: nst_server.cpp:80
CJsonNode GetBackendConfDiff(const CJsonNode &conf) const
Definition: nst_server.cpp:285
unsigned int m_NetworkTimeout
Definition: nst_server.hpp:161
unique_ptr< CNSTDatabase > m_Db
Definition: nst_server.hpp:167
CNSTDatabase & GetDb(void)
Definition: nst_server.cpp:401
CJsonNode x_diffInJson(const vector< string > &added, const vector< string > &deleted) const
Definition: nst_server.cpp:490
unsigned short m_Port
Definition: nst_server.hpp:153
void ResetDecryptCacheIfNeed(void)
Definition: nst_server.cpp:237
string x_GetCrashFlagFileName(void) const
Definition: nst_server.cpp:515
virtual ~CNetStorageServer()
Definition: nst_server.cpp:68
void RunServiceThread(void)
Definition: nst_server.cpp:471
enum EAlertAckResult AcknowledgeAlert(const string &id, const string &user)
Definition: nst_server.cpp:374
CRef< CNetStorageServiceThread > m_ServiceThread
Definition: nst_server.hpp:182
void RegisterNetStorageAPIDecryptError(const string &message)
Definition: nst_server.cpp:251
bool x_DoesCrashFlagFileExist(void) const
Definition: nst_server.cpp:521
void AddDefaultListener(IServer_ConnectionFactory *factory)
Definition: nst_server.cpp:73
bool m_NeedDecryptCacheReset
Definition: nst_server.hpp:193
CJsonNode SerializeAlerts(void) const
Definition: nst_server.cpp:395
void ReportNetStorageAPIDecryptSuccess(void)
Definition: nst_server.cpp:259
void RegisterAlert(EAlertType alert_type, const string &messge)
Definition: nst_server.cpp:388
CNSTAlerts m_Alerts
Definition: nst_server.hpp:166
virtual void Exit()
Cleanup the server.
Definition: nst_server.cpp:232
bool IsAdminClientName(const string &name) const
Definition: nst_server.cpp:354
void StopServiceThread(void)
Definition: nst_server.cpp:479
static CNetStorageServer * GetInstance(void)
Definition: nst_server.cpp:226
string CreateCrashFlagFile(void)
Definition: nst_server.cpp:603
set< string > m_AdminClientNames
Definition: nst_server.hpp:173
virtual bool ShutdownRequested(void)
Runs synchronously between iterations.
Definition: nst_server.cpp:211
CFastMutex m_AdminClientNamesLock
Definition: nst_server.hpp:172
void CheckStartAfterCrash(void)
Definition: nst_server.cpp:527
set< string > x_GetAdminClientNames(const string &client_names)
Definition: nst_server.cpp:365
CNSTPreciseTime m_LastDecryptCacheReset
Definition: nst_server.hpp:194
bool m_LogTimingClientSocket
Definition: nst_server.hpp:159
EServiceMetadataPresence InMetadataServices(const string &service) const
Definition: nst_server.cpp:412
bool GetServiceProperties(const string &service, CNSTServiceProperties &service_props) const
Definition: nst_server.cpp:448
bool GetServiceTTL(const string &service, TNSTDBValue< CTimeSpan > &ttl) const
Definition: nst_server.cpp:418
CJsonNode m_BackendConfiguration
Definition: nst_server.hpp:189
static CNetStorageServer * sm_netstorage_server
Definition: nst_server.hpp:169
CJsonNode ReadMetadataConfiguration(const IRegistry &reg)
Definition: nst_server.cpp:457
string x_GenerateGUID(void) const
Definition: nst_server.cpp:265
string RemoveCrashFlagFile(void)
Definition: nst_server.cpp:625
bool GetServiceProlongOnRead(const string &service, const TNSTDBValue< Int8 > &individual_obj_ttl, TNSTDBValue< CTimeSpan > &prolong_on_read) const
Definition: nst_server.cpp:426
CJsonNode SerializeMetadataInfo(void) const
Definition: nst_server.cpp:464
void SetShutdownFlag(int signum=0)
Definition: nst_server.cpp:217
void UpdateBackendConfiguration(const IRegistry &reg, vector< string > &config_warnings)
Definition: nst_server.cpp:276
bool GetServiceProlongOnWrite(const string &service, const TNSTDBValue< Int8 > &individual_obj_ttl, TNSTDBValue< CTimeSpan > &prolong_on_write) const
Definition: nst_server.cpp:437
CSocketAPI::
void RequestStop()
Schedule thread Stop.
IRegistry –.
Definition: ncbireg.hpp:73
IServer_ConnectionFactory::
Definition: server.hpp:388
NStr –.
Definition: ncbistr.hpp:243
const_iterator begin() const
Definition: set.hpp:135
const_iterator find(const key_type &key) const
Definition: set.hpp:137
const_iterator end() const
Definition: set.hpp:136
#define false
Definition: bool.h:36
static FILE * f
Definition: readconf.c:23
#define NULL
Definition: ncbistd.hpp:225
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
Definition: ncbidiag.hpp:186
bool CreatePath(TCreateFlags flags=fCreate_Default) const
Create the directory path recursively possibly more than one at a time.
Definition: ncbifile.cpp:4106
virtual bool Remove(TRemoveFlags flags=eRecursive) const
Remove a directory entry.
Definition: ncbifile.cpp:2595
static string MakePath(const string &dir=kEmptyStr, const string &base=kEmptyStr, const string &ext=kEmptyStr)
Assemble a path from basic components.
Definition: ncbifile.cpp:413
virtual bool Exists(void) const
Check existence of file.
Definition: ncbifile.hpp:4039
@ eReadWrite
File can be read and written.
Definition: ncbifile.hpp:3438
@ eCreate
Create a new file, or truncate an existing one.
Definition: ncbifile.hpp:3422
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
bool Empty(void) const THROWS_NONE
Check if CRef is empty – not pointing to any object, which means having a null value.
Definition: ncbiobj.hpp:719
int64_t Int8
8-byte (64-bit) signed integer
Definition: ncbitype.h:104
static TPid GetPid(void)
Get process identifier (pid) for the current process.
#define kEmptyStr
Definition: ncbistr.hpp:123
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
Definition: ncbistr.cpp:3452
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
Definition: ncbistr.hpp:673
@ fSplit_Truncate
Definition: ncbistr.hpp:2503
@ fSplit_MergeDelimiters
Merge adjacent delimiters.
Definition: ncbistr.hpp:2500
void GetParameters(SServer_Parameters *params)
Definition: server.cpp:631
void AddListener(IServer_ConnectionFactory *factory, unsigned short port)
Register a listener.
Definition: server.cpp:605
unsigned short m_Port
TCP port to listen on.
void SetParameters(const SServer_Parameters &new_params)
Definition: server.cpp:618
unsigned int max_connections
Maximum # of open connections.
Definition: server.hpp:436
bool Run(TRunMode flags=fRunDefault)
Run the thread.
Definition: ncbithr.cpp:724
void Join(void **exit_data=0)
Wait for the thread termination.
Definition: ncbithr.cpp:863
const struct ncbi::grid::netcache::search::fields::KEY key
T signum(T x_)
EAlertAckResult
Definition: ns_alert.hpp:63
EAlertType
Definition: ns_alert.hpp:46
@ eStartAfterCrash
Definition: ns_alert.hpp:51
@ eDataPathAbsence
Definition: nst_alert.hpp:61
@ eDecryptInNetStorageAPI
Definition: nst_alert.hpp:58
@ eCrashSignalFileCreation
Definition: nst_alert.hpp:62
CJsonNode NSTGetBackendConfiguration(const IRegistry &reg, CNetStorageServer *server, vector< string > &warnings)
Definition: nst_config.cpp:461
const bool default_log_timing_nst_api
const bool default_log_timing_client_socket
const bool default_log
const string kCrashFlagFileName("CRASH_FLAG")
USING_NCBI_SCOPE
Definition: nst_server.cpp:41
EServiceMetadataPresence
Defines NCBI C++ secure resources API.
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
SServer_Parameters::
Definition: server.hpp:434
Modified on Fri Sep 20 14:57:48 2024 by modify_doxy.py rev. 669887