当前位置: 首页>>代码示例>>C++>>正文


C++ Endpoint::ToString方法代码示例

本文整理汇总了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);
}
开发者ID:rokiCode,项目名称:scaliendb,代码行数:9,代码来源:Socket_Posix.cpp

示例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);
}
开发者ID:agazso,项目名称:keyspace,代码行数:20,代码来源:KeyspaceConn.cpp

示例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);
    }
}
开发者ID:crnt,项目名称:scaliendb,代码行数:38,代码来源:ConfigServerApp.cpp

示例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);
}
开发者ID:azybler,项目名称:scaliendb,代码行数:36,代码来源:ConfigServerApp.cpp


注:本文中的Endpoint::ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。