Skip to content

一款专为Linux C++开发人员和维护人员设计的,高效率的、使用便捷的远程文件存储工具,它包含由C++开发的服务端远程数据存储库、一个C++开发的演示应用,和一个配套的由Java开发的支持Windows/Linux/MacOS的客户端。

License

Notifications You must be signed in to change notification settings

zxc479773533/LetMeSeeSee

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LetMeSeeSee Platform (GNU/Linux) Build Status

English | 中文

About

LetMeSeeSee is an efficient and easy-to-use remote file storage tool designed for Linux C++ developers and maintainers. It includes a server-side remote data storage library developed by C++ and a client supporting Windows/Linux/MacOS developed by Java.

LetMeSeeSee is dedicated to solving the problem of server development and maintenance personnel running from the remote monitoring program. Every time data storage and error checking is performed, there is no need to recompile the program, modify the configuration, restart the software, and only need to configure all at the beginning, and the client sends a storage request to the corresponding storage node to obtain remote data.

You can use our library in your server code to launch a remote service with just three lines of code. The data storage function is automatically generated by the macro we provide. See the Usage section for specific instructions. In addition, we also provide a example, a remote system monitor developed using the LetMeSeeSee library for your reference.

Installing server library

Dependencies

Server

We recommend that you use the CMAKE tool of 3.10 or higher and gcc of version 7.0 and above to get a better use of the build experience. This does not mean that the tool cannot be used in an environment that does not meet the version requirements, but a low-level compilation tool may cause some unexpected errors in some environments.

The latest version can be compiled in gcc 4.8.5 environment with some warnings, but it does not affect the use.

Clinet

We recommend to install the Java 8 environment. Higher versions require manual installation of the Javafx package.

Install

Please execute the following commands in order to complete the installation:

git clone https://github.com/zxc479773533/LetMeSeeSee.git
cd LetMeSeeSee
cd src/server
mkdir build
cd build
cmake ..
make
sudo make install

Usage

Server

The following is an interface description for the lmss::Storager class:

class Storager {
  public:
    // Startup network service, listen the IP address and port in the parameter
    void ListenAndServe(const std::string &ip, uint16_t port);
    // Scan the source and convert all data storage nodes to json format
    void ScanSourceCode(const std::string &path);
    // Set the log file. If you do not call this function, the default is std::clog. If the parameter is empty, the log will not be printed.
    void SetLogFile(const std::string &filename);
    // Set the password. If you do not call this function, all any user connection
    void SetPassword(const std::string& password);
  };

An application example developed using LetMeSeeSee is as follows:(example/src/RemoteSysMonitor.cpp)

Some of the segments are selected for explanation here.

// Include the header file of LetMeSeeSee
#include <LetMeSeeSee/storager.h>

// Store Macro,parameter 1 is the name of storage node, parameter 2 is the file name of storage file
Store(Process_Info, process_info.csv) {
  std::string SaveFile = "../data/process_info.csv"; // Set the path to the data storage file on the server

  // Execute your storage behaviors

  return SaveFile; // Return storage file path
}

int main(int argc, char **argv) {
  // Use Storager
  lmss::Storager storager;

  //Scan the source and convert all data storage nodes to json format
  storager.ScanSourceCode("../src");

  // Start the network service and listen on port 1234
  storager.ListenAndServe("0.0.0.0", 1234);

  while (true) {
  
    // Do your operations
  
  }
}

You need to add these codes to your project by following the example above, and you can easily add all the features of LetMeSeeSee to your project.

Example

The sample program is a remote system monitor that you can install by executing the following command:

cd example
mkdir build
cd build
cmake ..
make

When running RemoteSM, add different parameters to enable the following functions:

Usage: ./RemoteSM [Options]
Options:
  --source   -s   <dir> : Specify source directory [Required]
  --datadir  -d   <dir> : Specify the savedata directory [Required]
  --addr     -a  <addr> : Specify the listen address (The default is 0.0.0.0)
  --port     -p  <port> : Specify the savedata directory [Required]
  --logfile  -l  <file> : Specify the log output directory
  --password -pd <file> : Specify the log output directory
  --local        <freq> : Store data by frequency

Clinet

We also provide a companion client developed by Java, you can download the latest version in release.

The client can establish a connection with the server by inputting the IP address and port number of the server, acquire the data storage node, and request data storage for the corresponding node.

The server can allow up to 20 clients to access at the same time.

If you use our server library in your project and want to develop the corresponding client interface, please pay attention to the following data format.

HTTP Request:
Header: CMD == nodelist or CMD == "node name"

HTTP Response:
Content: "Data"

Developers

  • zxcpyp
    • Product Manage
    • Server Development
    • UI&Logo Design
  • 金修旭
    • Clinet Development
  • Lab-Zjt
    • Server Development & Maintenance

We will continue to maintain this project and may update or reproduce the client in the future.

Copyright (c) 2018 zxcpyp, 金修旭, Lab-Zjt

Updated at 2019-03-15

Log

2019-02-24: Release version 1.0, a simple version with all basic functions

2019-03-07: Release version 1.2, we have finished all the work so this fantastic tool could be put in practical use.

2019-03-15: Release version 1.4, add password verification

2019-06-09: Release version 1.4.1, remove regex and make it adapt to the build environment of gcc4.8.5.

About

一款专为Linux C++开发人员和维护人员设计的,高效率的、使用便捷的远程文件存储工具,它包含由C++开发的服务端远程数据存储库、一个C++开发的演示应用,和一个配套的由Java开发的支持Windows/Linux/MacOS的客户端。

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages