consume Server upon listen

This commit is contained in:
Sean McArthur
2014-09-03 10:56:15 -07:00
parent 1ceb468ec3
commit 307311f745

View File

@@ -30,7 +30,7 @@ impl Server {
}
/// Binds to a socket, and starts handling connections.
pub fn listen<H: Handler + 'static>(&self, mut handler: H) -> IoResult<Listening> {
pub fn listen<H: Handler + 'static>(self, mut handler: H) -> IoResult<Listening> {
let mut listener = try!(TcpListener::bind(self.ip.to_string().as_slice(), self.port));
let socket = try!(listener.socket_name());
let acceptor = try!(listener.listen());