File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,17 @@ use libc::*;
88pub fn iterate_sockets_info (
99 af_flags : AddressFamilyFlags ,
1010 proto_flags : ProtocolFlags ,
11+ ) -> Result < impl Iterator < Item = Result < SocketInfo , Error > > , Error > {
12+ Ok ( attach_pids ( iterate_sockets_info_without_pids (
13+ af_flags,
14+ proto_flags,
15+ ) ?) )
16+ }
17+
18+ /// Iterate through sockets information without attaching PID.
19+ pub fn iterate_sockets_info_without_pids (
20+ af_flags : AddressFamilyFlags ,
21+ proto_flags : ProtocolFlags ,
1122) -> Result < impl Iterator < Item = Result < SocketInfo , Error > > , Error > {
1223 let ipv4 = af_flags. contains ( AddressFamilyFlags :: IPV4 ) ;
1324 let ipv6 = af_flags. contains ( AddressFamilyFlags :: IPV6 ) ;
@@ -32,7 +43,7 @@ pub fn iterate_sockets_info(
3243 }
3344 }
3445 }
35- Ok ( attach_pids ( iterators. into_iter ( ) . flatten ( ) ) )
46+ Ok ( iterators. into_iter ( ) . flatten ( ) )
3647}
3748
3849fn attach_pids (
You can’t perform that action at this time.
0 commit comments