Struct std::old_io::net::pipe::UnixStreamUnstable
[-] [+]
[src]
pub struct UnixStream { // some fields omitted }
A stream which communicates over a named pipe.
Methods
impl UnixStream
fn connect<P: BytesContainer>(path: P) -> IoResult<UnixStream>
Connect to a pipe named by path
. This will attempt to open a
connection to the underlying socket.
The returned stream will be closed when the object falls out of scope.
Example
fn main() { #![allow(unused_must_use)] use std::old_io::net::pipe::UnixStream; let server = Path::new("path/to/my/socket"); let mut stream = UnixStream::connect(&server); stream.write(&[1, 2, 3]); }use std::old_io::net::pipe::UnixStream; let server = Path::new("path/to/my/socket"); let mut stream = UnixStream::connect(&server); stream.write(&[1, 2, 3]);
fn connect_timeout<P>(path: P, timeout: Duration) -> IoResult<UnixStream> where P: BytesContainer
Connect to a pipe named by path
, timing out if the specified number of
milliseconds.
This function is similar to connect
, except that if timeout
elapses the function will return an error of kind TimedOut
.
If a timeout
with zero or negative duration is specified then
the function returns Err
, with the error kind set to TimedOut
.
fn close_read(&mut self) -> IoResult<()>
Closes the reading half of this connection.
This method will close the reading portion of this connection, causing all pending and future reads to immediately return with an error.
Note that this method affects all cloned handles associated with this stream, not just this one handle.
fn close_write(&mut self) -> IoResult<()>
Closes the writing half of this connection.
This method will close the writing portion of this connection, causing all pending and future writes to immediately return with an error.
Note that this method affects all cloned handles associated with this stream, not just this one handle.
fn set_timeout(&mut self, timeout_ms: Option<u64>)
Sets the read/write timeout for this socket.
For more information, see TcpStream::set_timeout
fn set_read_timeout(&mut self, timeout_ms: Option<u64>)
Sets the read timeout for this socket.
For more information, see TcpStream::set_timeout
fn set_write_timeout(&mut self, timeout_ms: Option<u64>)
Sets the write timeout for this socket.
For more information, see TcpStream::set_timeout