File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 4444{
4545 pub fn new ( stream : S ) -> Result < Self , Error > {
4646 let mut session = get_session ( None ) ?;
47- session. set_tcp_stream ( stream. as_raw_socket ( ) ) ;
47+ session. set_tcp_stream ( crate :: util :: RawSocketWrapper ( stream. as_raw_socket ( ) ) ) ;
4848
4949 let stream = Arc :: new ( stream) ;
5050
Original file line number Diff line number Diff line change 6262 configuration : impl Into < Option < SessionConfiguration > > ,
6363 ) -> Result < Self , Error > {
6464 let mut session = get_session ( configuration) ?;
65- session. set_tcp_stream ( stream. as_raw_socket ( ) ) ;
65+ session. set_tcp_stream ( crate :: util :: RawSocketWrapper ( stream. as_raw_socket ( ) ) ) ;
6666
6767 let stream = Arc :: new ( stream) ;
6868
Original file line number Diff line number Diff line change @@ -29,3 +29,14 @@ impl ConnectInfo {
2929 Self :: Unix ( path. as_ref ( ) . into ( ) )
3030 }
3131}
32+
33+ #[ cfg( windows) ]
34+ pub struct RawSocketWrapper ( pub std:: os:: windows:: io:: RawSocket ) ;
35+
36+ #[ cfg( windows) ]
37+ impl std:: os:: windows:: io:: AsRawSocket for RawSocketWrapper {
38+ #[ inline]
39+ fn as_raw_socket ( & self ) -> std:: os:: windows:: io:: RawSocket {
40+ self . 0
41+ }
42+ }
You can’t perform that action at this time.
0 commit comments