Struct string_telephone::client::Client [-]  [+] [src]

pub struct Client<T> {
    pub addr: SocketAddr,
    pub target_addr: SocketAddr,
    pub config: ConnectionConfig<T>,
    pub connection_state: ConnectionState,
    // some fields omitted
}

Clientside implementation of UDP networking

Fields

addr

The socket we should use locally

target_addr

The socket of the server we intent to connect to

config

Basic configuration for connecting

connection_state

What's the current state of our connection

Methods

impl<T> Client<T>

fn connect(addr: SocketAddr, target_addr: SocketAddr, config: ConnectionConfig<T>, client_connection_config: ClientConnectionConfig) -> IoResult<Client<T>>

Connect our Client to a target Server. Will block until either a valid connection is made, or we give up

fn poll(&mut self) -> Result<T, PollFailResult>

Pop the last event off of our comms queue, if any

fn send(&mut self, packet: &T)

Send a packet to the server

Trait Implementations

impl<T> Drop for Client<T>

fn drop(&mut self)