Struct cobalt::client::Client [] [src]

pub struct Client {
    // some fields omitted
}

A server client that uses a reliable UDP connection for unreliable packet transmission.

Methods

impl Client
[src]

fn new(config: Config) -> Client

Creates a new client with the given connection configuration.

fn connect<T: ToSocketAddrs>(&mut self, handler: &mut Handler<Client>, address: T) -> Result<()Error>

Tries to establish a reliable UDP based connection to the server specified by the address.

The server must use a compatible connection configuration in order for the connection to be actually established.

The handler is a struct that implements the Handler trait in order to handle events from the client and its connection.

fn close(&mut self)

Closes the clients connections to the server.