Struct cobalt::server::Server [] [src]

pub struct Server {
    // some fields omitted
}

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

Methods

impl Server
[src]

fn new(config: Config) -> Server

Creates a new server with the given connection configuration.

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

Tries to bind a reliable UDP based server to the specified local address which actively listens and manages incoming client connections.

The clients must use a compatible connection configuration in order for connections to be actually established.

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

fn shutdown(&mut self)

Shutsdown the server, closing all its active connections.