Skip to content

Commit

Permalink
Fix CE on 32bit os
Browse files Browse the repository at this point in the history
  • Loading branch information
bdbai committed May 17, 2021
1 parent 462c9bd commit 0729d7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sys/windows/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ impl TcpStream {

pub(crate) fn connect_mio(socket: TcpSocket, addr: SocketAddr) -> io::Result<TcpStream> {
// TODO: Safety
let os_socket = unsafe { ::std::net::TcpStream::from_raw_socket(socket as u64) };
let os_socket = unsafe { ::std::net::TcpStream::from_raw_socket(socket as RawSocket) };
os_socket.set_nonblocking(true)?;
Ok(TcpStream::new(os_socket, Some(addr)))
// let socket = os_socket.into_raw_socket();
Expand All @@ -146,7 +146,7 @@ impl TcpStream {
pub fn connect(addr: SocketAddr) -> io::Result<TcpStream> {
let socket = new_for_addr(addr)?;
// TODO: Safety
let os_socket = unsafe { ::std::net::TcpStream::from_raw_socket(socket as u64) };
let os_socket = unsafe { ::std::net::TcpStream::from_raw_socket(socket as RawSocket) };
os_socket.set_nonblocking(true)?;
let socket = os_socket.into_raw_socket();
connect(socket as usize, addr).map(|s| TcpStream::new(s, Some(addr)))
Expand Down

0 comments on commit 0729d7a

Please sign in to comment.