rustlang tcp客户端例子

use std::io::prelude::*; use std::net::TcpStream; use std::io::stdin; use std::thread; fn main() { let mut stream=TcpStream::connect("127.0.0.1:8080").unwrap(); stream.set_nodelay(true).unwrap(); loop{ let mut test_strea

rustlang tcp服务端例子

use std::net::TcpListener; use std::{thread, time}; use std::net::TcpStream; use std::io::prelude::*; use std::io::stdin; use std::sync::Arc; use std::sync::Mutex; use std::net::Shutdown; use std::sync::atomic::{AtomicUsize, Ordering}; fn main() {