本文整理汇总了C++中Sender::start方法的典型用法代码示例。如果您正苦于以下问题:C++ Sender::start方法的具体用法?C++ Sender::start怎么用?C++ Sender::start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sender
的用法示例。
在下文中一共展示了Sender::start方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: lansink_start
int lansink_start(snd_pcm_ioplug_t *_pPlug) {
Sender *pPlug = (Sender *)_pPlug->private_data;
try {
pPlug->start();
pPlug->log.debug("%s() = %d", __FUNCTION__, 0);
} catch (std::exception &e) {
pPlug->log.error(e.what());
}
return 0;
}
示例2: main
int main()
{
int ret = 0;
try
{
Receiver rcvr;
rcvr.connect(8181);
EchoCommunicator echo;
echo.setName("EchoCommunicator");
rcvr.registerComm(&echo);
echo.start();
FileProcessingCommunicator fileComm;
fileComm.setName("FileHandlerCommunicator");
rcvr.registerComm(&fileComm);
fileComm.start();
string targetAddr = "127.0.0.1", targetPort = "8080";
Sender sender;
sender.setName("SenderCommunicator");
rcvr.registerComm(&sender);
sender.start();
StringSearchCommunicator stringSearchComm;
stringSearchComm.setName("StringSearchCommunicator");
rcvr.registerComm(&stringSearchComm);
stringSearchComm.start();
echo.wait();
fileComm.wait();
echo.stop();
fileComm.stop();
}
catch (std::exception& ex)
{
std::cout << "\n\n " << ex.what();
ret = 1;
}
catch (...)
{
sout << "\n something bad happened";
ret = 1;
}
sout << "\n\n";
return ret;
}
示例3: main
int main()
{
Worker work;
work.start();
Sender send;
g_wk = &work;
send.start(work);
bool ret = SetConsoleCtrlHandler((PHANDLER_ROUTINE) signal_handle, true);
if (ret == false)
{
std::clog << "Registery signal failed!" << std::endl;
exit(-1);
}
while (!g_exit)
{
boost::chrono::milliseconds dura(2000);
boost::this_thread::sleep_for(dura);
}
return 0;
}
示例4: main
int main()
{
title("Testing Socket Client", '=');
try
{
Verbose v(true);
Sender S;
Message M("FileUpload", 9070, "localhost", 9080, "../hi.JPG");
S.start(M);
title("Client sending File...Be Patient...Connection will close in time");
title("To Force Connection close Press Any Key");
std::cin.get();
S.closeConnection();
}
catch (std::exception& ex)
{
Verbose::show(" Exception caught:", always);
Verbose::show(std::string("\n ") + ex.what() + "\n\n");
}
}