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


C++ client::send方法代码示例

本文整理汇总了C++中client::send方法的典型用法代码示例。如果您正苦于以下问题:C++ client::send方法的具体用法?C++ client::send怎么用?C++ client::send使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在client的用法示例。


在下文中一共展示了client::send方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: on_open

void on_open(client* c, websocketpp::connection_hdl hdl) {
    // now it is safe to use the connection
    std::cout << "connection ready" << std::endl;

    received=false;
    // Send a SIP OPTIONS message to the server:
    std::string SIP_msg="OPTIONS sip:[email protected] SIP/2.0\r\nVia: SIP/2.0/WS df7jal23ls0d.invalid;rport;branch=z9hG4bKhjhs8ass877\r\nMax-Forwards: 70\r\nTo: <sip:[email protected]>\r\nFrom: Alice <sip:[email protected]>;tag=1928301774\r\nCall-ID: a84b4c76e66710\r\nCSeq: 63104 OPTIONS\r\nContact: <sip:[email protected]>\r\nAccept: application/sdp\r\nContent-Length: 0\r\n\r\n";
    sip_client.send(hdl, SIP_msg.c_str(), websocketpp::frame::opcode::text);
}
开发者ID:2uropa,项目名称:cpprestsdk,代码行数:9,代码来源:sip_client.cpp

示例2: echo

void echo(int messages, int factor)
{
    for (int j = 0; j < factor; j++) {
        for (int i = 0; i < messages; i++) {
            clientIO.send(connectionVector[rand() % connectionVector.size()], ECHO_MESSAGE, websocketpp::frame::opcode::value::BINARY);
            sent++;
        }
    }
}
开发者ID:AlmirKadric,项目名称:uWebSockets,代码行数:9,代码来源:bench2.cpp

示例3: echoMessage

void echoMessage(int i)
{
    echoed = false;

    clientIO.send(heavyConnections[i], ECHO_MESSAGE, websocketpp::frame::opcode::value::TEXT);

    while(!echoed) {
        clientIO.run_one();
    }
}
开发者ID:oleg7814,项目名称:node-lws,代码行数:10,代码来源:main.cpp

示例4: operator

    void operator()(client& c, std::string message)
    {
        std::smatch match;
        std::regex expression("^:(\\S+) PRIVMSG (\\S+)+ :!alice$");
        std::regex_search(message, match, expression);

        if(match.size())
        {
            std::string sender = match[2];
            std::string message = g.getSentence();
            c.send("PRIVMSG " + sender + " :" + message);
        }
    }
开发者ID:hef,项目名称:strup,代码行数:13,代码来源:main.cpp

示例5: onPing

void client::onPing(client& c, std::string message)
{
    std::smatch match;
    std::regex e("PING :(.*)");
    std::regex_match(message, match, e);

    if(match.size())
    {
        std::string pong("PONG :");
        pong += match[1];
        c.send(pong);
    }
}
开发者ID:hef,项目名称:strup,代码行数:13,代码来源:client.cpp


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