本文整理汇总了C++中Endpoint::ToString方法的典型用法代码示例。如果您正苦于以下问题:C++ Endpoint::ToString方法的具体用法?C++ Endpoint::ToString怎么用?C++ Endpoint::ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Endpoint
的用法示例。
在下文中一共展示了Endpoint::ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ToString
const char* Socket::ToString(char s[ENDPOINT_STRING_SIZE])
{
Endpoint endpoint;
if (!GetEndpoint(endpoint))
return "";
return endpoint.ToString(s);
}
示例2: Init
void KeyspaceConn::Init(KeyspaceDB* kdb_, KeyspaceServer* server_)
{
Log_Trace();
TCPConn<KEYSPACE_BUF_SIZE>::Init();
if (!running)
Log_Trace("KeyspaceConn::Init(): running == false");
running = true;
KeyspaceService::Init(kdb_);
server = server_;
closeAfterSend = false;
bytesRead = 0;
Endpoint endpoint;
socket.GetEndpoint(endpoint);
endpoint.ToString(endpointString);
Log_Message("[%s] Keyspace: client connected", endpointString);
}
示例3: Init
void ConfigServerApp::Init()
{
int sdbpPort;
Endpoint httpEndpoint;
ReadBuffer docroot;
ReadBuffer prefix;
ReadBuffer index;
httpHandler.SetConfigServer(&configServer);
httpServer.Init(configFile.GetIntValue("http.port", 8080));
httpServer.RegisterHandler(&httpHandler);
docroot.Wrap(configFile.GetValue("http.documentRoot", "."));
prefix.Wrap(configFile.GetValue("http.staticPrefix", "/webadmin"));
index.Wrap(configFile.GetValue("http.directoryIndex", "index.html"));
httpFileHandler.Init(docroot, prefix);
httpFileHandler.SetDirectoryIndex(index);
httpServer.RegisterHandler(&httpFileHandler);
sdbpPort = configFile.GetIntValue("sdbp.port", 7080);
sdbpServer.Init(sdbpPort);
sdbpServer.SetContext(&configServer);
// start configServer only after network servers are started
configServer.Init();
configServer.GetHTTPEndpoint(httpEndpoint);
Log_Message("Web admin is started at http://%s%R", httpEndpoint.ToString(), &prefix);
Log_Message("Waiting for connections on port %d", sdbpPort);
statTimer.SetDelay(configFile.GetIntValue("controller.logStatTime", 0));
if (statTimer.GetDelay() != 0)
{
statTimer.SetCallable(MFUNC(ConfigServerApp, OnStatTimer));
EventLoop::Add(&statTimer);
}
}
示例4: Init
void ConfigServerApp::Init()
{
int sdbpPort;
Endpoint httpEndpoint;
ReadBuffer docroot;
ReadBuffer prefix;
ReadBuffer index;
httpHandler.SetConfigServer(&configServer);
httpServer.Init(configFile.GetIntValue("http.port", 8080));
httpServer.RegisterHandler(&httpHandler);
docroot.Wrap(configFile.GetValue("http.documentRoot", "."));
prefix.Wrap(configFile.GetValue("http.staticPrefix", "/webadmin"));
index.Wrap(configFile.GetValue("http.directoryIndex", "index.html"));
httpFileHandler.Init(docroot, prefix);
httpFileHandler.SetDirectoryIndex(index);
httpServer.RegisterHandler(&httpFileHandler);
sdbpPort = configFile.GetIntValue("sdbp.port", 7080);
sdbpServer.Init(sdbpPort);
sdbpServer.SetContext(&configServer);
sdbpServer.UseKeepAlive(false);
// start configServer only after network servers are started
configServer.Init(this);
configServer.GetHTTPEndpoint(httpEndpoint);
Log_Message("Web admin is started at http://%s%R", httpEndpoint.ToString(), &prefix);
Log_Message("Waiting for connections on port %d", sdbpPort);
logStatTimer.SetCallable(MFUNC(ConfigServerApp, OnLogStatTimer));
// logStatTime is in seconds in the config file, default is 10min
SetLogStatTimeout(configFile.GetIntValue("controller.logStatTime", 600) * 1000);
}