Skip to content

Commit b493b77

Browse files
djcjaymell
authored andcommitted
Update socket2
1 parent 500ce6e commit b493b77

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ streams = []
7575

7676
[dev-dependencies]
7777
rand = "0.8"
78-
socket2 = "0.3"
78+
socket2 = "0.4"
7979
assert_approx_eq = "1.0"
8080
fnv = "1.0.5"
8181
futures = "0.3"

tests/support/mod.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#![allow(dead_code)]
22

3-
use std::{env, fs, io, net::SocketAddr, path::PathBuf, process, thread::sleep, time::Duration};
3+
use std::{
4+
env, fs, io, net::SocketAddr, net::TcpListener, path::PathBuf, process, thread::sleep,
5+
time::Duration,
6+
};
47

58
use futures::Future;
69
use redis::Value;
@@ -73,11 +76,11 @@ impl RedisServer {
7376
// this is technically a race but we can't do better with
7477
// the tools that redis gives us :(
7578
let addr = &"127.0.0.1:0".parse::<SocketAddr>().unwrap().into();
76-
let socket = Socket::new(Domain::ipv4(), Type::stream(), None).unwrap();
79+
let socket = Socket::new(Domain::IPV4, Type::STREAM, None).unwrap();
7780
socket.set_reuse_address(true).unwrap();
7881
socket.bind(addr).unwrap();
7982
socket.listen(1).unwrap();
80-
let listener = socket.into_tcp_listener();
83+
let listener = TcpListener::from(socket);
8184
let redis_port = listener.local_addr().unwrap().port();
8285
if tls {
8386
redis::ConnectionAddr::TcpTls {

0 commit comments

Comments
 (0)