@@ -86,11 +86,11 @@ impl TcpStream {
8686 }
8787
8888 pub fn peer_addr ( & self ) -> io:: Result < SocketAddr > {
89- unsupported ( )
89+ self . inner . peer_addr ( )
9090 }
9191
9292 pub fn socket_addr ( & self ) -> io:: Result < SocketAddr > {
93- unsupported ( )
93+ self . inner . socket_addr ( )
9494 }
9595
9696 pub fn shutdown ( & self , _: Shutdown ) -> io:: Result < ( ) > {
@@ -114,15 +114,15 @@ impl TcpStream {
114114 }
115115
116116 pub fn nodelay ( & self ) -> io:: Result < bool > {
117- unsupported ( )
117+ self . inner . nodelay ( )
118118 }
119119
120120 pub fn set_ttl ( & self , _: u32 ) -> io:: Result < ( ) > {
121121 unsupported ( )
122122 }
123123
124124 pub fn ttl ( & self ) -> io:: Result < u32 > {
125- unsupported ( )
125+ self . inner . ttl ( )
126126 }
127127
128128 pub fn take_error ( & self ) -> io:: Result < Option < io:: Error > > {
@@ -140,53 +140,55 @@ impl fmt::Debug for TcpStream {
140140 }
141141}
142142
143- pub struct TcpListener ( !) ;
143+ pub struct TcpListener {
144+ inner : tcp:: Tcp ,
145+ }
144146
145147impl TcpListener {
146148 pub fn bind ( _: io:: Result < & SocketAddr > ) -> io:: Result < TcpListener > {
147149 unsupported ( )
148150 }
149151
150152 pub fn socket_addr ( & self ) -> io:: Result < SocketAddr > {
151- self . 0
153+ unsupported ( )
152154 }
153155
154156 pub fn accept ( & self ) -> io:: Result < ( TcpStream , SocketAddr ) > {
155- self . 0
157+ unsupported ( )
156158 }
157159
158160 pub fn duplicate ( & self ) -> io:: Result < TcpListener > {
159- self . 0
161+ unsupported ( )
160162 }
161163
162164 pub fn set_ttl ( & self , _: u32 ) -> io:: Result < ( ) > {
163- self . 0
165+ unsupported ( )
164166 }
165167
166168 pub fn ttl ( & self ) -> io:: Result < u32 > {
167- self . 0
169+ self . inner . ttl ( )
168170 }
169171
170172 pub fn set_only_v6 ( & self , _: bool ) -> io:: Result < ( ) > {
171- self . 0
173+ unsupported ( )
172174 }
173175
174176 pub fn only_v6 ( & self ) -> io:: Result < bool > {
175- self . 0
177+ unsupported ( )
176178 }
177179
178180 pub fn take_error ( & self ) -> io:: Result < Option < io:: Error > > {
179- self . 0
181+ unsupported ( )
180182 }
181183
182184 pub fn set_nonblocking ( & self , _: bool ) -> io:: Result < ( ) > {
183- self . 0
185+ unsupported ( )
184186 }
185187}
186188
187189impl fmt:: Debug for TcpListener {
188190 fn fmt ( & self , _f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
189- self . 0
191+ todo ! ( )
190192 }
191193}
192194
0 commit comments