File tree Expand file tree Collapse file tree 1 file changed +0
-4
lines changed Expand file tree Collapse file tree 1 file changed +0
-4
lines changed Original file line number Diff line number Diff line change @@ -11,24 +11,20 @@ fn smoke_bind_connect() {
1111 let tmp = std:: env:: temp_dir ( ) ;
1212 let sock_path = tmp. join ( "rust-test-uds.sock" ) ;
1313
14- // 1. 绑定
1514 let listener = UnixListener :: bind ( & sock_path) . expect ( "bind failed" ) ;
1615
17- // 2. 并发连接
1816 let tx = thread:: spawn ( move || {
1917 let mut stream = UnixStream :: connect ( & sock_path) . expect ( "connect failed" ) ;
2018 stream. write_all ( b"hello" ) . expect ( "write failed" ) ;
2119 } ) ;
2220
23- // 3. 接受
2421 let ( mut stream, _) = listener. accept ( ) . expect ( "accept failed" ) ;
2522 let mut buf = [ 0 ; 5 ] ;
2623 stream. read_exact ( & mut buf) . expect ( "read failed" ) ;
2724 assert_eq ! ( & buf, b"hello" ) ;
2825
2926 tx. join ( ) . unwrap ;
3027
31- // 4. 清理
3228 drop ( listener) ;
3329 let _ = std:: fs:: remove_file ( & sock_path) ;
3430}
You can’t perform that action at this time.
0 commit comments