Skip to content

Commit 519e051

Browse files
committed
minor refactor
1 parent f6cf317 commit 519e051

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ws/robust/stream.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ type Socket = WebSocketStream<MaybeTlsStream<TcpStream>>;
2020
type Writer = SplitSink<Socket, protocol::Message>;
2121
type Reader = SplitStream<Socket>;
2222

23+
const PING_INTERVAL: Duration = Duration::from_secs(50);
24+
const PONG_TIMEOUT: Duration = Duration::from_secs(60);
25+
2326
pub async fn connect(base_url: &BaseUrl) -> Result<Socket> {
2427
let url = format!("ws{}/ws", &BaseUrl::get_url(base_url)[4..]);
2528

@@ -62,9 +65,6 @@ fn parse_message(message: protocol::Message) -> Result<Option<Message>> {
6265
}
6366
}
6467

65-
const PING_INTERVAL: Duration = Duration::from_secs(50);
66-
const PONG_TIMEOUT: Duration = Duration::from_secs(60);
67-
6868
pub async fn stream(
6969
mut reader: Reader,
7070
writer: Arc<Mutex<Writer>>,

0 commit comments

Comments
 (0)