Skip to content

Instantly share code, notes, and snippets.

@hackallcode
Created November 27, 2017 18:52
Show Gist options
  • Save hackallcode/e38a595a08da18fa20bd8e287476463d to your computer and use it in GitHub Desktop.
Save hackallcode/e38a595a08da18fa20bd8e287476463d to your computer and use it in GitHub Desktop.
lab12

Laboratory work XII

Написать программу на C++ обеспечивающую асинхронный запрос по заданному URL к HTTPS серверу на получение кода доступа. Для создания асинхронного запроса необходимо использовать следующие примитивы многопоточного программирования: std::thread для управления потоком и std::promise для ассинхронной обработки кода ответа. Передача аргумента происходит через командную строку.

Tasks

  • 1. Создать публичный репозиторий с названием lab12 на сервисе GitHub
  • 2. Выполнить инструкцию учебного материала
  • 3. Ознакомиться со ссылками учебного материала
  • 4. Составить отчет и отправить ссылку личным сообщением в Slack

Tutorial

$ export GITHUB_USERNAME=hackallcode
$ alias edit=nano
$ cd ~/workspace
$ source scripts/activate
$ mkdir projects/lab12 && cd projects/lab12
$ git inti
$ git remote add origin git@github.com:${GITHUB_USERNAME}/lab12
$ edit CMakeLists.txt
$ edit sources/cget.cpp
$ cmake -H. -B_build -DCMAKE_INSTALL_PREFIX=_install
$ cmake --build _build --target install
$ ./_install/bin/cget https://yandex.ru
200
$ cat >> .travis.yml <<EOF
language: cpp
script:
- cmake -H. -B_build -DCMAKE_INSTALL_PREFIX=_install
- cmake --build _build --target install
- ./_install/bin/cget https://yandex.ru
EOF
$ git add .
$ git commit -m"first commit"
$ git push origin master
$ travis login --auto
$ travis enable

Report

$ cd ~/workspace
$ source scripts/activate
$ mkdir reports/lab12 && cd reports/lab12
$ edit REPORT.md
$ gistup -m "lab12"

Links

Protocols:

Documentaion:

Hunter:

Examples:

Copyright (c) 2017 Братья Вершинины
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment