| | |
| | | #define NET_MODE_REQUEST_HEAD_LENGTH 16 |
| | | #define NET_MODE_RESPONSE_HEAD_LENGTH 4 |
| | | |
| | | class NetModServerSocket; |
| | | |
| | | struct net_node_t |
| | | { |
| | | const char *host; |
| | |
| | | }; |
| | | |
| | | class NetModSocket { |
| | | |
| | | friend class NetModServerSocket; |
| | | private: |
| | | static std::map<std::string, rio_t *> connectionMap; |
| | | ShmModSocket shmModSocket; |
| | |
| | | |
| | | static void * encode_response_head(net_mod_response_head_t & response); |
| | | static net_mod_response_head_t decode_response_head(void *_headbs); |
| | | |
| | | |
| | | public: |
| | | |
| | | NetModSocket(); |
| | |
| | | INCLUDES += -I${DEST}/include/shmqueue -I$(ROOT)/include/usgcommon |
| | | |
| | | |
| | | PROGS = ${DEST}/net_mod_req_rep |
| | | PROGS = ${DEST}/net_mod_socket |
| | | |
| | | DEPENDENCES = $(patsubst %, %.d, $(PROGS)) |
| | | |
| | | #LIBCOMMON=${ROOT}/lib/libusgcommon.a |
| | | |
| | | build: $(PROGS) |
| | | cp -a net_mod_req_rep.sh ${DEST} |
| | | |
| | | # class |
| | | #$(DEST)/kucker : kucker.c |
| | | build: $(PROGS) |
| | | cp -a net_mod_socket.sh ${DEST} |
| | | |
| | | |
| | | clean: |
File was renamed from test_net_socket/net_mod_req_rep.sh |
| | |
| | | |
| | | ./dgram_mod_bus server 8 & |
| | | |
| | | ./net_mod_req_rep server 5000 & |
| | | ./net_mod_socket server 5000 & |
| | | |
| | | } |
| | | |
| | | function client() { |
| | | ./net_mod_req_rep client 5000 |
| | | ./net_mod_socket client 5000 |
| | | } |
| | | |
| | | function close() { |
| | | ps -ef | grep -e "dgram_mod_req_rep" -e "net_mod_req_rep" -e "dgram_mod_bus" | awk '{print $2}' | xargs -i kill -9 {} |
| | | ps -ef | grep -e "dgram_mod_req_rep" -e "net_mod_socket" -e "dgram_mod_bus" | awk '{print $2}' | xargs -i kill -9 {} |
| | | ipcrm -a |
| | | } |
| | | |