add network

This commit is contained in:
King
2024-05-18 14:10:08 +00:00
parent f4c0b74285
commit 5a7fa95d2c
6 changed files with 738 additions and 0 deletions

37
kvstore.h Normal file
View File

@@ -0,0 +1,37 @@
#ifndef __KV_STORE_H__
#define __KV_STORE_H__
#define NETWORK_REACTOR 0
#define NETWORK_PROACTOR 1
#define NETWORK_NTYCO 2
#define NETWORK_SELECT NETWORK_REACTOR
typedef int (*msg_handler)(char *msg, int length, char *response);
extern int reactor_start(unsigned short port, msg_handler handler);
extern int proactor_start(unsigned short port, msg_handler handler);
extern int ntyco_start(unsigned short port, msg_handler handler);
const char *command[] = {
"SET", "GET", "DEL", "MOD", "EXIST"
};
const char *response[] = {
};
#endif