Skip to content

Commit

Permalink
Merge pull request #44 from Thomasdezeeuw/socket2_update
Browse files Browse the repository at this point in the history
Update to socket2 v0.4
  • Loading branch information
faern authored Mar 22, 2021
2 parents 5aeb38e + 0ee38ce commit 72b5ff8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ features = [

[dev-dependencies]
rand = "0.8.0"
socket2 = "0.3.18"
socket2 = "0.4.0"
16 changes: 5 additions & 11 deletions src/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1108,13 +1108,10 @@ mod tests {
});

let cp = t!(CompletionPort::new(1));
let domain = match addr {
SocketAddr::V4(..) => Domain::ipv4(),
SocketAddr::V6(..) => Domain::ipv6(),
};
let socket = t!(Socket::new(domain, Type::stream(), None));
let domain = Domain::for_address(addr);
let socket = t!(Socket::new(domain, Type::STREAM, None));
t!(socket.bind(&addr_template.into()));
let socket = socket.into_tcp_stream();
let socket = TcpStream::from(socket);
t!(cp.add_socket(1, &socket));

let a = Overlapped::zero();
Expand Down Expand Up @@ -1268,11 +1265,8 @@ mod tests {
});

let cp = t!(CompletionPort::new(1));
let domain = match addr {
SocketAddr::V4(..) => Domain::ipv4(),
SocketAddr::V6(..) => Domain::ipv6(),
};
let socket = t!(Socket::new(domain, Type::stream(), None)).into_tcp_stream();
let domain = Domain::for_address(addr);
let socket = TcpStream::from(t!(Socket::new(domain, Type::STREAM, None)));
t!(cp.add_socket(1, &l));

let a = Overlapped::zero();
Expand Down

0 comments on commit 72b5ff8

Please sign in to comment.