Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UDP example does nothing #273

Open
TheRadioGuy opened this issue Apr 29, 2020 · 1 comment
Open

UDP example does nothing #273

TheRadioGuy opened this issue Apr 29, 2020 · 1 comment

Comments

@TheRadioGuy
Copy link

TheRadioGuy commented Apr 29, 2020

Hey, I copied UDP example and added in main this:

 fn main() {
    send_data();
    receive_data();
} 

And it does nothing

image

@CrabBucket
Copy link

CrabBucket commented May 12, 2020

I am also having issues but your main is messed up first, you need to unwrap send_data() im fairly certain. Second you are sending the data then going into the recieve loop. Regardless nothing is happening in this main either by running it as a server then running the client:

fn main() {
    let mut is_server = false;
    if arg_count() > 2 {
        println!("Invalid number of arguments max number of arguments allowed is 2");
        std::process::exit(0);
    }
    for flag in get_flags() {
        match flag.flag_type {
            FlagType::Server => {
                is_server = true;
            }
            _ => {

            }   
        }
    }
    if is_server {
        receive_data();
        std::process::exit(0);
    }
    send_data().unwrap();


}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants