File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -153,18 +153,16 @@ impl Socket {
153
153
154
154
#[ cfg( windows) ]
155
155
pub async fn accept ( & self ) -> io:: Result < ( Self , SockAddr ) > {
156
- let local_addr = self . local_addr ( ) ?;
156
+ let domain = self . local_addr ( ) ?. domain ( ) ;
157
157
let ty = self . socket . r#type ( ) ?;
158
158
let protocol = self . socket . protocol ( ) ?;
159
- let accept_sock =
160
- compio_runtime:: spawn_blocking ( move || Socket2 :: new ( local_addr. domain ( ) , ty, protocol) )
161
- . await ?;
159
+ let accept_sock = Self :: new ( domain, ty, protocol) . await ?;
162
160
let op = Accept :: new ( self . as_raw_fd ( ) , accept_sock. as_raw_fd ( ) as _ ) ;
163
161
let BufResult ( res, op) = Runtime :: current ( ) . submit ( op) . await ;
164
162
res?;
165
163
op. update_context ( ) ?;
166
164
let addr = op. into_addr ( ) ?;
167
- Ok ( ( Self :: from_socket2 ( accept_sock) ? , addr) )
165
+ Ok ( ( accept_sock, addr) )
168
166
}
169
167
170
168
pub fn close ( self ) -> impl Future < Output = io:: Result < ( ) > > {
You can’t perform that action at this time.
0 commit comments