Skip to content

Commit

Permalink
minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
abrkn committed Aug 23, 2024
1 parent f6cf317 commit 519e051
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ws/robust/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ type Socket = WebSocketStream<MaybeTlsStream<TcpStream>>;
type Writer = SplitSink<Socket, protocol::Message>;
type Reader = SplitStream<Socket>;

const PING_INTERVAL: Duration = Duration::from_secs(50);
const PONG_TIMEOUT: Duration = Duration::from_secs(60);

pub async fn connect(base_url: &BaseUrl) -> Result<Socket> {
let url = format!("ws{}/ws", &BaseUrl::get_url(base_url)[4..]);

Expand Down Expand Up @@ -62,9 +65,6 @@ fn parse_message(message: protocol::Message) -> Result<Option<Message>> {
}
}

const PING_INTERVAL: Duration = Duration::from_secs(50);
const PONG_TIMEOUT: Duration = Duration::from_secs(60);

pub async fn stream(
mut reader: Reader,
writer: Arc<Mutex<Writer>>,
Expand Down

0 comments on commit 519e051

Please sign in to comment.