Struct tiny_http::Server
[−]
[src]
pub struct Server { // some fields omitted }
The main class of this library.
Destroying this object will immediatly close the listening socket annd the reading
part of all the client's connections. Requests that have already been returned by
the recv()
function will not close and the responses will be transferred to the client.
Methods
impl Server
[src]
fn incoming_requests(&self) -> IncomingRequests
Returns an iterator for all the incoming requests.
The iterator will return None
if the server socket is shutdown.
fn get_server_addr(&self) -> SocketAddr
Returns the address the server is listening to.
fn get_num_connections(&self) -> usize
Returns the number of clients currently connected to the server.
fn recv(&self) -> IoResult<Request>
Blocks until an HTTP request has been submitted and returns it.
fn try_recv(&self) -> IoResult<Option<Request>>
Same as recv()
but doesn't block.