- Add libmsg: C++20 header-only pymsg protocol implementation - Msg.hpp: pmsg_send/pmsg_recv (blocking + deadline modes) + MsgClient - MsgServer.hpp: multi-client TCP server with select event loop + thread pool - AsyncQueue<T>: generic async batch processing queue - RpcClient/RpcServer: JSON RPC convention layer (requires boost::json) - Msg_Basic.hpp/cpp: exception hierarchy, constants, version - Fix thread safety: MsgClient _sockfd/_running use std::atomic with exchange() - Fix deadline recv: client call() uses shared deadline for header+payload - Fix graceful shutdown: thread pool drains queued tasks before exit - Fix pmsg_send size check: enforce 64MiB limit (was 4GiB no-op check) - Align AsyncQueue batch semantics with Python: batch_size is threshold - Refactor gateway/LogC.hpp to use libmsg AsyncQueue<T> - Update gateway Makefile to link -lus_msg, DbC.hpp to use <us/Msg.hpp> - Add libmsg to _inst.sh build order
40 lines
1.0 KiB
Makefile
40 lines
1.0 KiB
Makefile
VERSION := 0.0.1
|
|
FRAMEWORK_NAME := us
|
|
LIB_NAME := libus_msg
|
|
INSTL_TDIR := /lib
|
|
INCLU_TDIR := /usr/include
|
|
INCLU_SDIR := inc
|
|
CPP := g++
|
|
INCS := -I inc
|
|
CPPFLAGS := --std=c++20 -O3 -pipe -Wall -Werror
|
|
LIBS :=
|
|
BUILD_TDIR := build
|
|
$(shell mkdir -p $(BUILD_TDIR))
|
|
|
|
#--------
|
|
all: $(BUILD_TDIR)/$(LIB_NAME).so
|
|
|
|
$(BUILD_TDIR)/$(LIB_NAME).so: $(BUILD_TDIR)/Msg_Basic.o
|
|
$(CPP) -shared $^ $(LIBS) -o $@
|
|
|
|
$(BUILD_TDIR)/Msg_Basic.o: src/Msg_Basic.cpp
|
|
$(CPP) $(CPPFLAGS) -fPIC -c $^ $(INCS) -o $@
|
|
|
|
clear:
|
|
@rm -rvf $(BUILD_TDIR)
|
|
|
|
install:
|
|
@echo "install UniServe_libmsg..."
|
|
@mkdir -vp $(INCLU_TDIR)/$(FRAMEWORK_NAME)
|
|
@cp -vf $(INCLU_SDIR)/$(FRAMEWORK_NAME)/Msg_Basic.hpp $(INCLU_TDIR)/$(FRAMEWORK_NAME)/
|
|
@cp -vf $(INCLU_SDIR)/$(FRAMEWORK_NAME)/Msg.hpp $(INCLU_TDIR)/$(FRAMEWORK_NAME)/
|
|
@cp -vf $(BUILD_TDIR)/$(LIB_NAME).so $(INSTL_TDIR)/
|
|
@echo "done."
|
|
|
|
uninstall:
|
|
@echo "uninstall UniServe_libmsg..."
|
|
@rm -vf $(INCLU_TDIR)/$(FRAMEWORK_NAME)/Msg_Basic.hpp
|
|
@rm -vf $(INCLU_TDIR)/$(FRAMEWORK_NAME)/Msg.hpp
|
|
@rm -vf $(INSTL_TDIR)/$(LIB_NAME).so
|
|
@echo "done."
|