pub fn listen<A: ToSocketAddrs, T>(addr: A, data: T) -> Result<Server<T>, Error>
Expand description
Creates a new Server
which will be listening for incoming connections on
the specified address using the provided data
.
The returned server is ready for serving.
Examples
Creates a Redcon server listening at 127.0.0.1:6379
:
let my_data = "hello";
let server = redcon::listen("127.0.0.1:6379", my_data).unwrap();