-
Goal
Retrieve file whose data may be passed as multilple packets in arbitrary order, reorder the data to form the expected file with sequence number of packets
-
Environment
Unix OS (my environment: MSYS2 in Windows)
-
Prerequisite of Module/Package
autoconf automake libtool openssl libcurl gcc
-
libcurl installation (refer to https://curl.se/ and https://github.com/curl/curl instructions)
- Clone the source code from https://github.com/curl/curl
- Open terminal at the root of the git repository (i.e. [User path]/curl/)
- Input command "autoreconf -fi"
- Input command "./config --with-ssl" or "./config --with-openssl" (can be replaced with any supported ssl pacakge you have)
- Input command "make"
- Input command "make install"
- Input command "curl -V" to check if the curl is installed success and get details (supported protocols)
-
Execution
- Open terminal at this project folder
- Input command "gcc main.c -lcurl -o [output_name]" (ex: gcc main.c -lcurl -o application.exe)
- Input command "./[output_name] [URL:PORT]" (ex: ./application.exe www.example.com:1234)
- Check the "data.out" and "result.out" files, the former is the data downloaded from server and the latter is the result file with data reordered.