Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Assignment completed as part of the IFT3325 course at Université de Montréal.

NotificationsYou must be signed in to change notification settings

etiennecollin/ift3325

Repository files navigation

rust tests workflow

Dependencies

Note

The code was tested usingrustc 1.82.0.

Usage

Run the server:

./server<port_number><prob_frame_drop><prob_bit_flip>

Run the client:

./client<server_address><server_port><file><go_back_n><prob_frame_drop><prob_bit_flip>

Note

If the file sent only contains the stringshutdown, the server will shutdown.

Note

The probabilities are given as floating point numbers in the range [0, 1]and are independent probabilities.

Example usage

In this example, the client and server are used. Each frame from the serverhas a 10% probability of being dropped and a 10% probability of suffering abit flip.

cargo run --release -p server 8080 0.1 0.1cargo run --release -p client 127.0.0.1 8080<file_path> 0 0 0

Testing

To run the tests, use:

cargotest

For a better test UI and parallel execution of tests, usecargo-nextest.Install it with:

cargo install cargo-nextest --locked

and run the tests with:

cargo nextest run

Logging

The log level may be changed through an environment variable.

RUST_LOG=<log_level>

where<log_level> is, in increasing order of severity, either:

  • DEBUG
  • INFO
  • WARN
  • ERROR

By default, the log level used isINFO.

Debugging vs. Release

Use the--profile dev flag for a debug build, and the--release flag for a release build:

# Debugcargo run --profile dev -p<target><args># Releasecargo run --release -p<target><args>

<args> are the args for the executable and<target> is either:

  • server
  • client

Note

The code is available athttps://github.com/etiennecollin/ift3325

About

Assignment completed as part of the IFT3325 course at Université de Montréal.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

[8]ページ先頭

©2009-2025 Movatter.jp