10 #include "HelloService.hpp"
11 #include <pion/net/HTTPResponseWriter.hpp>
14 using namespace pion::net;
23 void HelloService::operator()(HTTPRequestPtr& request, TCPConnectionPtr& tcp_conn)
25 static const std::string HELLO_HTML =
"<html><body>Hello World!</body></html>";
26 HTTPResponseWriterPtr writer(HTTPResponseWriter::create(tcp_conn, *request,
27 boost::bind(&TCPConnection::finish, tcp_conn)));
28 writer->writeNoCopy(HELLO_HTML);
29 writer->writeNoCopy(HTTPTypes::STRING_CRLF);
30 writer->writeNoCopy(HTTPTypes::STRING_CRLF);