pub fn bind<F, U, N: AsRef<str>>(mut self, name: N, addr: U, factory: F) -> io::Result<Self>
    where
        F: ServiceFactory<TcpStream>,
        U: net::ToSocketAddrs,
    {
        let sockets = bind_addr(addr, self.backlog)?;

        for lst in sockets {
            let token = self.token.next();
            self.services.push(StreamNewService::create(
                name.as_ref().to_string(),
                token,
                factory.clone(),
                lst.local_addr()?,
            ));
            self.sockets
                .push((token, name.as_ref().to_string(), StdListener::Tcp(lst)));
        }
        Ok(self)
    }
/// Add new service to the server.
Add new service to the server.
Add new service to the server .
pub fn bind<F, U, N: AsRef<str>>(mut self, name: N, addr: U, factory: F) -> io::Result<Self>
    where
        F: ServiceFactory<TcpStream>,
        U: net::ToSocketAddrs,
    {
        let sockets = bind_addr(addr, self.backlog)?;
        for lst in sockets {
            let token = self.token.next();
            self.services.push(StreamNewService::create(
                name.as_ref().to_string(),
                token,
                factory.clone(),
                lst.local_addr()?,
            ));
            self.sockets
                .push((token, name.as_ref().to_string(), StdListener::Tcp(lst)));
        }
        Ok(self)
    }
pub fn bind < F , U , N : AsRef < str > > ( mut self , name : N , addr : U , factory : F ) -> io :: Result < Self > where F : ServiceFactory < TcpStream > , U : net :: ToSocketAddrs , { let sockets = bind_addr ( addr , self . backlog ) ? ; for lst in sockets { let token = self . token . next ( ) ; self . services . push ( StreamNewService :: create ( name . as_ref ( ) . to_string ( ) , token , factory . clone ( ) , lst . local_addr ( ) ? , ) ) ; self . sockets . push ( ( token , name . as_ref ( ) . to_string ( ) , StdListener :: Tcp ( lst ) ) ) ; } Ok ( self ) }
Add new service to the server.
Add new service to the server .
mut self
name
N
addr
U
factory
F
mut self
name
N
addr
U
factory
F