本文整理汇总了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();
}
}
示例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();
}
示例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();
}
示例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);
}
}
示例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();
}
示例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();
}
示例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();
}
示例8: ReceiveAndTerminate
/*
* Receive some data and terminate
*/
void SocketTest::ReceiveAndTerminate(ConnectedDescriptor *socket) {
Receive(socket);
m_ss->Terminate();
}
示例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();
}
示例10: FailedEchoComplete
void RpcChannelTest::FailedEchoComplete() {
m_ss.Terminate();
OLA_ASSERT_TRUE(m_controller.Failed());
}
示例11: EchoComplete
void RpcChannelTest::EchoComplete() {
m_ss.Terminate();
OLA_ASSERT_FALSE(m_controller.Failed());
OLA_ASSERT_EQ(m_reply.data(), m_request.data());
}