本文整理汇总了C++中Router::getNext方法的典型用法代码示例。如果您正苦于以下问题:C++ Router::getNext方法的具体用法?C++ Router::getNext怎么用?C++ Router::getNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Router
的用法示例。
在下文中一共展示了Router::getNext方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: use
/* Mounts a Router instance to the server. */
void WebApp::use(Router * router) {
Router * routerNode = m_routerTail;
while(routerNode->getNext() != NULL){
routerNode = routerNode->getNext();
}
routerNode->setNext(router);
}
示例2: process
/* Processes an incoming connection with request buffer and length given as parameters. */
void WebApp::process(Client *client, char *buff, int bufflen) {
m_clientObject = client;
bool routeMatch = false;
if (m_clientObject != NULL) {
m_request.init(m_clientObject, buff, bufflen);
m_response.init(m_clientObject);
m_request.processRequest();
if (m_request.method() == Request::INVALID) {
m_failureCommand(m_request, m_response);
} else {
m_request.processHeaders(m_headerTail);
Router* routerNode = m_routerTail;
while(routerNode != NULL){
if (routerNode->dispatchCommands(m_request, m_response)) {
routeMatch = true;
}
routerNode = routerNode->getNext();
}
if (!routeMatch) {
m_notFoundCommand(m_request, m_response);
}
}
m_request.reset();
m_response.reset();
}
}