Skip to content

[Feature] RakNet Client Peer #40

@john-bv

Description

@john-bv

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?;
}

Metadata

Metadata

Assignees

Labels

CompleteThe code review for this issue has been completed; and is now being finalized.CoreA core related issue or PRMajorThis issue or PR contains major changes

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions