Struct sbd::directip::Server[][src]

pub struct Server<A: ToSocketAddrs + Sync, S: Storage + Sync + Send> { /* fields omitted */ }
Expand description

A Iridium DirectIP server.

The server will listen on a socket address for incoming Iridium SBD Mobile Originated messages. Incoming messages will be stored using sbd::filesystem::Storage. Errors are logged using the logging framework.

Implementations

Creates a new server that will listen on addr and write messages to storage.

This method does not actually bind to the socket address or do anything with the storage. Use bind and serve_forever to actually do stuff.

The provided storage is expected to be ready to accept new messages.

Examples
let storage = sbd::storage::MemoryStorage::new();
let server = sbd::directip::Server::new("0.0.0.0:10800", storage);

Binds this server to its tcp socket.

This is a seperate operation from serve_forever so that we can capture any errors associated with the underlying TcpListener::bind.

Examples
let storage = sbd::storage::MemoryStorage::new();
let mut server = sbd::directip::Server::new("0.0.0.0:10800", storage);
server.bind().unwrap();

Starts the DirectIP server and serves forever.

Panics

This method panics if it has a problem binding to the tcp socket address. To avoid a panic, use Server::bind before calling Server::serve_forever.

Examples
let storage = sbd::storage::MemoryStorage::new();
let mut server = sbd::directip::Server::new("0.0.0.0:10800", storage);
server.bind().unwrap();
server.serve_forever();

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.