1
0
mirror of https://github.com/fumiama/simple-dict.git synced 2026-06-05 10:10:26 +08:00
Go to file
2021-12-08 23:17:00 +08:00
2021-05-19 13:02:47 +08:00
2021-05-19 00:42:35 +08:00
2021-05-29 14:45:55 +08:00
2021-08-31 13:26:50 +08:00
2021-05-19 00:42:35 +08:00
2021-12-08 20:25:23 +08:00
2021-12-08 20:21:50 +08:00
2021-06-11 15:15:44 +08:00
2021-05-19 00:42:35 +08:00
2021-05-19 00:42:35 +08:00
2021-05-19 00:42:35 +08:00
2021-12-08 23:17:00 +08:00
2021-12-08 20:25:23 +08:00

simple-dict-server

database["key"]="value"

Compile

You should first clone this project into a system with cmake & libpthread installed. If you plan to compile it on Windows, you should edit the source code and transform socket/thread/file libraries into Windows version.

git clone https://github.com/fumiama/simple-dict-server.git

Create a build folder.

cd simple-dict-server
mkdir build

Use cmake command to generate files for make automatically.

cd build
cmake ../

Use make to generate executable binary files named simple-dict-server and simple-dict-client in ./build directory.

make

Execute

Start server on localhost using the commands below.

chmod +x simple-dict-server simple-dict-client
./simple-dict-server -d 7777 1 ./dict.sp ./cfg.sp    # use -d to start as daemon

Open another shell to connect to it.

./simple-dict-client 127.0.0.1 7777

Now you have connected to the server. Type fumiama and press enter in 10 seconds to get the read/write access. You can modify the password in source code as you like. Please note that the server will only wait 10 seconds for a response after the last communication. The box below shows how to control the server to accompilsh basic add/del/find/edit operations.

The raw data starts with an integer showing its size, then a char $ follows, finally following all binary data in ./dict.sp.

Android Client for simple-dict-server

There is also an Android Client for simple-dict-server. Just install the apk file downloaded from release page and click config icon to set your server address using the format

127.0.0.1:7777_password

Note that this APP is designed for a new language called Tenenja, so the font inside is abnormal. What's more, there is no English translation for this APP because its users are Chinese. If you want to get an APP in your language, just edit the source code for free.

Languages
C 95.5%
CMake 3.1%
Dockerfile 1.4%