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


C++ SelectServer::Terminate方法代码示例

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


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

示例1: HandleMessage

/*
 * Handle the flash page replies
 */
void FirmwareTransferer::HandleMessage(uint8_t label,
                                       const uint8_t *data,
                                       unsigned int length) {
  if (label != FLASH_PAGE_LABEL || length != FLASH_STATUS_LENGTH)
    return;

  if (0 == memcmp(data, REPLY_SUCCESS, sizeof(FLASH_STATUS_LENGTH))) {
    if (!SendNextChunk() || m_sucessful)
      m_ss->Terminate();
  } else {
    OLA_FATAL << "Bad response from widget:" << string((const char*) data, 4);
    m_ss->Terminate();
  }
}
开发者ID:mlba-team,项目名称:open-lighting,代码行数:17,代码来源:usbpro-firmware.cpp

示例2: OnConnect

/*
 * Called when a connection completes or times out.
 */
void AdvancedTCPConnectorTest::OnConnect(TCPSocket *socket) {
  OLA_ASSERT_NOT_NULL(socket);

  GenericSocketAddress address = socket->GetPeerAddress();
  OLA_ASSERT_TRUE(address.Family() == AF_INET);
  OLA_ASSERT_EQ(m_localhost, address.V4Addr().Host());

  m_connected_socket = socket;
  m_ss->Terminate();
}
开发者ID:Jurrie,项目名称:ola,代码行数:13,代码来源:AdvancedTCPConnectorTest.cpp

示例3: OnConnect

/*
 * Called when a connection completes or times out.
 */
void AdvancedTCPConnectorTest::OnConnect(TcpSocket *socket) {
  CPPUNIT_ASSERT(socket);

  IPV4Address address;
  uint16_t port;
  CPPUNIT_ASSERT(socket->GetPeer(&address, &port));
  CPPUNIT_ASSERT_EQUAL(m_localhost, address);

  m_connected_socket = socket;
  m_ss->Terminate();
}
开发者ID:huyanming,项目名称:open-lighting,代码行数:14,代码来源:AdvancedTCPConnectorTest.cpp

示例4: OnConnect

/**
 * Called when a connection completes or times out.
 */
void TCPConnectorTest::OnConnect(int fd, int error) {
  if (error) {
    std::ostringstream str;
    str << "Failed to connect: " << strerror(error);
    OLA_ASSERT_EQ_MSG(0, error, str.str());
    m_ss->Terminate();
  } else {
    OLA_ASSERT_TRUE(fd >= 0);
    close(fd);
  }
}
开发者ID:Jazeido,项目名称:ola,代码行数:14,代码来源:TCPConnectorTest.cpp

示例5: Stream

void TestServiceImpl::Stream(RpcController* controller,
                             const ::ola::rpc::EchoRequest* request,
                             STREAMING_NO_RESPONSE* response,
                             CompletionCallback* done) {
  OLA_ASSERT_FALSE(controller);
  OLA_ASSERT_FALSE(response);
  OLA_ASSERT_FALSE(done);
  OLA_ASSERT_TRUE(request);
  OLA_ASSERT_EQ(string("foo"), request->data());
  m_ss->Terminate();
}
开发者ID:Jazeido,项目名称:ola,代码行数:11,代码来源:RpcChannelTest.cpp

示例6: DeviceDisconnected

void LogicReader::DeviceDisconnected(U64 device) {
  OLA_FATAL << "Device " << device << " disconnected";

  MutexLocker lock(&m_mu);
  if (device != m_device_id) {
    return;
  }
  m_device_id = 0;
  m_logic = NULL;

  m_ss->Terminate();
}
开发者ID:FloEdelmann,项目名称:ola,代码行数:12,代码来源:logic-rdm-sniffer.cpp

示例7: UDPReceiveAndTerminate

/*
 * Receive some data and check it.
 */
void SocketTest::UDPReceiveAndTerminate(UDPSocket *socket) {
  IPV4Address expected_address;
  OLA_ASSERT_TRUE(IPV4Address::FromString("127.0.0.1", &expected_address));

  IPV4SocketAddress source;

  uint8_t buffer[sizeof(test_cstring) + 10];
  ssize_t data_read = sizeof(buffer);
  socket->RecvFrom(buffer, &data_read, &source);
  OLA_ASSERT_EQ(static_cast<ssize_t>(sizeof(test_cstring)), data_read);
  OLA_ASSERT_EQ(expected_address, source.Host());
  m_ss->Terminate();
}
开发者ID:Keeper-of-the-Keys,项目名称:ola,代码行数:16,代码来源:SocketTest.cpp

示例8: ReceiveAndTerminate

/*
 * Receive some data and terminate
 */
void SocketTest::ReceiveAndTerminate(ConnectedDescriptor *socket) {
  Receive(socket);
  m_ss->Terminate();
}
开发者ID:Keeper-of-the-Keys,项目名称:ola,代码行数:7,代码来源:SocketTest.cpp

示例9: OnConnectFailure

/**
 * Called when a connection completes or times out.
 */
void TCPConnectorTest::OnConnectFailure(int fd, int error) {
  // The error could be one of many things, right now we just check it's non-0
  OLA_ASSERT_NE(0, error);
  OLA_ASSERT_EQ(-1, fd);
  m_ss->Terminate();
}
开发者ID:Jazeido,项目名称:ola,代码行数:9,代码来源:TCPConnectorTest.cpp

示例10: FailedEchoComplete

void RpcChannelTest::FailedEchoComplete() {
  m_ss.Terminate();
  OLA_ASSERT_TRUE(m_controller.Failed());
}
开发者ID:Jazeido,项目名称:ola,代码行数:4,代码来源:RpcChannelTest.cpp

示例11: EchoComplete

void RpcChannelTest::EchoComplete() {
  m_ss.Terminate();
  OLA_ASSERT_FALSE(m_controller.Failed());
  OLA_ASSERT_EQ(m_reply.data(), m_request.data());
}
开发者ID:Jazeido,项目名称:ola,代码行数:5,代码来源:RpcChannelTest.cpp


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