Struct sctp::SctpStream [] [src]

pub struct SctpStream(_);

One-to-one SCTP connected stream which behaves like a TCP stream. A SctpStream can be obtained either actively by connecting to a SCTP endpoint with the connect constructor, or passively from a SctpListener which accepts new connections

Methods

impl SctpStream

fn connect<A: ToSocketAddrs>(address: A) -> Result<SctpStream>

Create a new stream by connecting it to a remote endpoint

fn connectx<A: ToSocketAddrs>(addresses: &[A]) -> Result<SctpStream>

Create a new stream by connecting it to a remote endpoint having multiple addresses

fn sendmsg(&self, msg: &[u8], stream: u16) -> Result<usize>

Send bytes on the specified SCTP stream. On success, returns the quantity of bytes read

fn recvmsg(&self, msg: &mut [u8]) -> Result<(usize, u16)>

Read bytes. On success, return a tuple with the quantity of bytes received and the stream they were recived on

fn local_addrs(&self) -> Result<Vec<SocketAddr>>

Return the list of local socket addresses for this stream

fn peer_addrs(&self) -> Result<Vec<SocketAddr>>

Return the list of socket addresses for the peer this stream is connected to

fn shutdown(&self, how: Shutdown) -> Result<()>

Shuts down the read, write, or both halves of this connection

fn set_nodelay(&self, nodelay: bool) -> Result<()>

Set or unset SCTP_NODELAY option

fn has_nodelay(&self) -> Result<bool>

Verify if SCTP_NODELAY option is activated for this socket

fn set_buffer_size(&self, dir: SoDirection, size: usize) -> Result<()>

Set the socket buffer size for the direction specified by dir. Linux systems will double the provided size

fn get_buffer_size(&self, dir: SoDirection) -> Result<usize>

Get the socket buffer size for the direction specified by dir

fn set_timeout(&self, dir: SoDirection, timeout: i32) -> Result<()>

Set timeout in seconds for operation dir (either receive or send)

fn try_clone(&self) -> Result<SctpStream>

Try to clone the SctpStream. On success, returns a new stream wrapping a new socket handler

Trait Implementations

impl Read for SctpStream

fn read(&mut self, buf: &mut [u8]) -> Result<usize>

fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>

fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>

fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>

fn by_ref(&mut self) -> &mut Self

fn bytes(self) -> Bytes<Self>

fn chars(self) -> Chars<Self>

fn chain<R>(self, next: R) -> Chain<Self, R> where R: Read

fn take(self, limit: u64) -> Take<Self>

fn tee<W>(self, out: W) -> Tee<Self, W> where W: Write

impl Write for SctpStream

fn write(&mut self, buf: &[u8]) -> Result<usize>

fn flush(&mut self) -> Result<()>

fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>

fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>

fn by_ref(&mut self) -> &mut Self

fn broadcast<W>(self, other: W) -> Broadcast<Self, W> where W: Write

impl AsRawFd for SctpStream

fn as_raw_fd(&self) -> RawFd

impl FromRawFd for SctpStream

unsafe fn from_raw_fd(fd: RawFd) -> SctpStream