Skip to content

Commit 9eb5735

Browse files
committed
To keep backward compatibility of API, sendmsg_ppid() is introduced.
1 parent ddecba9 commit 9eb5735

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/lib.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,13 @@ impl SctpStream {
8484

8585
/// Send bytes on the specified SCTP stream. On success, returns the
8686
/// quantity of bytes read
87-
pub fn sendmsg(&self, msg: &[u8], ppid: u32, stream: u16) -> Result<usize> {
87+
pub fn sendmsg(&self, msg: &[u8], stream: u16) -> Result<usize> {
88+
return self.0.sendmsg::<SocketAddr>(msg, None, 0, stream, 0);
89+
}
90+
91+
/// Send bytes on the specified SCTP stream. On success, returns the
92+
/// quantity of bytes read
93+
pub fn sendmsg_ppid(&self, msg: &[u8], ppid: u32, stream: u16) -> Result<usize> {
8894
return self.0.sendmsg::<SocketAddr>(msg, None, ppid, stream, 0);
8995
}
9096

@@ -233,8 +239,8 @@ impl SctpEndpoint {
233239

234240
/// Send data in Sctp style, to the provided address on the stream `stream`.
235241
/// On success, returns the quantity on bytes sent
236-
pub fn send_to<A: ToSocketAddrs>(&self, msg: &mut [u8], address: A, ppid: u32, stream: u16) -> Result<usize> {
237-
return self.0.sendmsg(msg, Some(address), ppid, stream, 0);
242+
pub fn send_to<A: ToSocketAddrs>(&self, msg: &mut [u8], address: A, stream: u16) -> Result<usize> {
243+
return self.0.sendmsg(msg, Some(address), 0, stream, 0);
238244
}
239245

240246
/// Get local socket addresses to which this socket is bound

0 commit comments

Comments
 (0)