Server and client libraries for socket communication with topology features in linux, supporting TCP/IP and Unix Domain socket, and TLS. Features are handling requests in parallel and tiny enough to be embeded in program.
- Abstraction Layer
- API Layer (WIP)
- Code Layer (WIP)
- The way server deal with request is like the concept of
goroutine
in GO. You set the maximum amount of threads (or by default, maximum is 2 threads) to deal with requests. It's not thread-pool with fixed amount of threads, the amount of threads is dynamic, so it can be 1 to maximum amount in any time. - Server can be frozen with all threads or certain threads by the call from client. More details are in the
example
folder.
client_core
is a client library for single-thread used. It send request and wait for the reply.client_thread
is a client library for multi-thread used. It can send request and open a new thread to receive the reply.
- If you want to use this library under TLS (openssl), you will need
openssl-devel
.
yum install openssl-devel
apt-get install libssl-dev
g++ -lssl -lcrypto ...
- Only for Linux (kernel > 2.5.44 because using
epoll.h
). gcc
> 4.9, due to this bug- Header-only library, so copy
hast
folder to your include folder. - This project use
std::thread
, so compile file withstd::thread
library (Can be-pthread
).
- More information about how to use this library in this repository's wiki page.
- There is another my project called dalahast, which is a example for this project. It contain a complete system from web front-end to hast back-end.
- hast_web is a library base on this project. The difference between them is that hast_web open a websocket port and remove all topology features.
This project is still in developed and maintained. Open an issue if you discover some problems.