You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use std::io::net::tcp::TcpListener;use std::io::net::ip::{Ipv4Addr,SocketAddr};use std::io::{Acceptor,Listener};let addr = SocketAddr{ip:Ipv4Addr(127,0,0,1),port:80};let listener = TcpListener::bind(addr);// bind the listener to the specified addressletmut acceptor = listener.listen();// accept connections and process themfor stream in acceptor.incoming(){spawn(proc(){handle_client(stream);});}// close the socket serverdrop(acceptor);
but the handle_client function isn't defined, and it's not particularly obvious what it should be, having something like
fnhandle_client(mutstream:TcpStream){// ...}
in the code too would make it easier to interpret. (I'm sure this isn't the only example of this.)