Linux: ubuntu14 64bit g++4.8.1 tested
MacOSX: LLVM version 6.1.0 tested
programmer can write operations for exit
can use valgrind to check memory leak
use epoll on Linux
use kqueue on MacOSX
only 10 lines can finish a complete server
#include <handy/handy.h>
using namespace handy;
int main(int argc, const char* argv[]) {
EventBase base;
Signal::signal(SIGINT, [&]{ base.exit(); });
TcpServerPtr svr = TcpServer::startServer(&base, "", 99);
exitif(svr == NULL, "start tcp server failed");
svr->onConnRead([](const TcpConnPtr& con) {
con->send(con->getInput());
});
base.loop();
}
processing I/O asynchronously and Request synchronously can greatly simplify the coding of business processing
example can be found examples/hsha.cc
asynchronously handle the openssl connection. if you have installed openssl, then make will automatically download handy-ssl. ssl support files are in handy-ssl because of license.
###protobuf supported
examples can be found in directory protobuf
###Installation
make && make install
###contents
###hand book
Use of this source code is governed by a BSD-style license that can be found in the License file.
Вы можете оставить комментарий после Вход в систему
Неприемлемый контент может быть отображен здесь и не будет показан на странице. Вы можете проверить и изменить его с помощью соответствующей функции редактирования.
Если вы подтверждаете, что содержание не содержит непристойной лексики/перенаправления на рекламу/насилия/вульгарной порнографии/нарушений/пиратства/ложного/незначительного или незаконного контента, связанного с национальными законами и предписаниями, вы можете нажать «Отправить» для подачи апелляции, и мы обработаем ее как можно скорее.
Комментарии ( 0 )