Skip to content

Commit

Permalink
chore: doc about conv=0
Browse files Browse the repository at this point in the history
  • Loading branch information
zonyitoo committed Jul 10, 2024
1 parent 96a9630 commit 3e3ac1f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ impl KcpStream {
}

/// Create a `KcpStream` connecting to `addr`
///
/// `conv` is the conversation identifier, setting to `0` will let server to randomly generate one for you.
pub async fn connect_with_conv(config: &KcpConfig, conv: u32, addr: SocketAddr) -> KcpResult<KcpStream> {
let udp = match addr.ip() {
IpAddr::V4(..) => UdpSocket::bind("0.0.0.0:0").await?,
Expand All @@ -76,6 +78,8 @@ impl KcpStream {
}

/// Create a `KcpStream` with an existed `UdpSocket` connecting to `addr`
///
/// `conv` is the conversation identifier, setting to `0` will let server to randomly generate one for you.
pub async fn connect_with_socket_conv(
config: &KcpConfig,
conv: u32,
Expand Down

0 comments on commit 3e3ac1f

Please sign in to comment.