void Client::handleCall()
{
	auto p = reinterpret_cast<PacketCall*>(&receive_);
	std::cout << "Received call for " << (p->global ? "all" : "me") << " @ " << std::asctime(std::localtime(&p->time));
	
	// Call all onCalls
	for (auto onCall : onCalls_)
	{
		onCall(p->global);
	}
}
示例#2
0
void HttpMethod::call()
{
    try
    {
        onCall();
    }
    catch (base::AppException& e)
    {
        LOG(error, EXCEPTION_DIAG_INFO(e));
        replyError(400, e.msg());
    }
    catch (exception& e)
    {
        LOG(error, EXCEPTION_DIAG_INFO(e));
        replyError(500, e.what());
    }
}
示例#3
0
void ScriptFunction::operator()(const ScriptFunctionParameter* parameter, ScriptFunctionResult* result) const
{
	onCall(parameter, result);

	ScriptEnvironment::initScriptNodes();
}