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


C++ connection::pointer类代码示例

本文整理汇总了C++中connection::pointer的典型用法代码示例。如果您正苦于以下问题:C++ pointer类的具体用法?C++ pointer怎么用?C++ pointer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: listen

void Server::listen()
{
    Connection::pointer connection = Connection::create(*this);
    m_acceptor.async_accept(connection->socket(),
                            boost::bind(&Server::accept, this, connection,
                                        ba::placeholders::error));
}
开发者ID:oKcerG,项目名称:SmackTT,代码行数:7,代码来源:server.cpp

示例2: accept

void Server::accept(Connection::pointer connection, const boost::system::error_code& error)
{
    std::string ip = connection->socket().remote_endpoint().address().to_v4().to_string();
    std::cout << "-----------------------------------------\n";
    std::cout << "New request coming from " << ip << std::endl;
    if (!error)
        connection->start();
    else
        std::cout << "Server accept error : " << error.message() << std::endl;
    listen();
}
开发者ID:oKcerG,项目名称:SmackTT,代码行数:11,代码来源:server.cpp

示例3: operator

	void operator()(connection::pointer ptr)
	{
		std::cout << "Request handler" << std::endl;
		std::ostringstream oss;
		oss << ptr->get_request_url() << '\n';
		for (connection::headers_type::const_iterator it = ptr->get_headers().begin(), end = ptr->get_headers().end();
			it != end; ++it)
		{
			oss << "[" << it->first << "]=[" << it->second << "]" << std::endl;
		}
		ptr->send_response(200, oss.str());
	}
开发者ID:klupek,项目名称:asio_http,代码行数:12,代码来源:main.cpp

示例4: handle_accept

	/**
	 * Run when new connection is accepted
	 *
	 * @param new_connection accepted connection
	 * @param error reference to error object
	 */
	void handle_accept(connection::pointer new_connection,
					   const boost::system::error_code& error) 	{
		if (!error) {
			new_connection->start();
			start_accept();
		}
	}
开发者ID:AFialkovskiy,项目名称:boost-asio-examples,代码行数:13,代码来源:test-mcmt.cpp

示例5: handle_accept

void server::handle_accept(connection::pointer new_connection, const bs::error_code& error) {
  //	std::cout << "server::handle_accept" << std::endl;
  if (!error) {
    new_connection->start();
    start_accept();
  }
}
开发者ID:huydx,项目名称:custom_proxy,代码行数:7,代码来源:proxy-server.cpp

示例6: handle_accept

  void handle_accept(connection::pointer new_connection,
      const asio::error_code& error)
  {
    if (!error)
    {
      new_connection->start();
    }

    start_accept();
  }
开发者ID:BorisSchaeling,项目名称:asio,代码行数:10,代码来源:third_party_lib.cpp

示例7: main

int main()
{
  DBus::init();

  Connection::pointer connection = DBus::Connection::create( DBus::BUS_SESSION );

  SignalMessage::pointer message;
  message = SignalMessage::create( "/test/signal/Object",  // object name of the signal
                                   "test.signal.Type",     // interface name of the signal
                                   "Test" );               // name of the signal

  const char* sigvalue1 = "Hello World";

  // append arguments onto signal
  message << sigvalue1;

  // send the message and flush the connection
  connection << message;
  connection->flush();

  usleep(250000);
}
开发者ID:psukys,项目名称:dbus-cxx,代码行数:22,代码来源:signal_emitter_raw.cpp

示例8: handle_accept

void NetworkRecorder::handle_accept(Connection::pointer new_connection,
                                    const boost::system::error_code& error)
{
    if (!error)
    {
        {
            OpenCVImage image;
            {
                boost::mutex::scoped_lock lock(m_lock);
                image.copyFrom(m_buffer);
                image.setSize(160, 120);
            }

            new_connection->sendImage(&image);
        }

        start_accept();
    }
}
开发者ID:JasonHagler,项目名称:tortuga,代码行数:19,代码来源:NetworkRecorder.cpp


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