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

[Feature] RakNet Client Peer #40

Closed
john-bv opened this issue Apr 25, 2023 · 0 comments · Fixed by #42
Closed

[Feature] RakNet Client Peer #40

john-bv opened this issue Apr 25, 2023 · 0 comments · Fixed by #42
Assignees
Labels
Complete The code review for this issue has been completed; and is now being finalized. Core A core related issue or PR Major This issue or PR contains major changes

Comments

@john-bv
Copy link
Member

john-bv commented Apr 25, 2023

This issue is a followup for #39

The RFC Allows you to open a RakNet Peer Client to connect to other RakNet instances. This RFC contains the following functions:

  • Connect to a server instance

  • Force ACK/NAK flush

Example:

use rakrs::client::Client;

async fn connect(address: &'static str) -> Result<(), std::error::Error> {
    let mut conn = Client::new(&address, 10);
    conn.open();

    loop {
        let buf = conn.recv().await?;
        // Send a packet on ordered channel
        conn.send_ord(&[buf], 0);
        // Send a packet sequenced 
        conn.send_seq(&[buf], 0);
        // Send packet reliably (not ord, use send_ord for that)
        conn.send(&[buf], Reliability::Reliable);
    }

    // flush ack and nack forcefully.
    conn.flush_ack();
    conn.close().await?;
}
@john-bv john-bv self-assigned this Apr 25, 2023
@john-bv john-bv linked a pull request Jun 11, 2023 that will close this issue
@john-bv john-bv added Core A core related issue or PR Major This issue or PR contains major changes Complete The code review for this issue has been completed; and is now being finalized. and removed Core labels Jun 17, 2023
@john-bv john-bv closed this as completed Sep 18, 2023
@NetrexMC NetrexMC locked as resolved and limited conversation to collaborators Sep 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Complete The code review for this issue has been completed; and is now being finalized. Core A core related issue or PR Major This issue or PR contains major changes
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant