Public Member Functions
Dashel::FileDescriptorStream Class Reference

File descriptor, uses send/recv for read/write. More...

Inheritance diagram for Dashel::FileDescriptorStream:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 FileDescriptorStream (const string &protocolName)
 Create the stream and associates a file descriptor.
virtual void flush ()
 Flushes stream.
virtual void read (void *data, size_t size)
 Reads data from the stream.
virtual bool receiveDataAndCheckDisconnection ()
 If necessary, read a byte and check for disconnection; return true on disconnection, fales otherwise.
virtual void write (const void *data, const size_t size)
 Write data to the stream.

Detailed Description

File descriptor, uses send/recv for read/write.

Definition at line 677 of file dashel-posix.cpp.


Constructor & Destructor Documentation

Dashel::FileDescriptorStream::FileDescriptorStream ( const string &  protocolName) [inline]

Create the stream and associates a file descriptor.

Definition at line 681 of file dashel-posix.cpp.


Member Function Documentation

virtual void Dashel::FileDescriptorStream::flush ( ) [inline, virtual]

Flushes stream.

Calling this function requests the stream to be flushed, this may ensure that data is written to physical media or actually sent over a wire. The exact performed function depends on the stream type and operating system.

Implements Dashel::Stream.

Reimplemented in Dashel::SerialStream, Dashel::FileStream, Dashel::StdoutStream, and Dashel::StdinStream.

Definition at line 716 of file dashel-posix.cpp.

virtual void Dashel::FileDescriptorStream::read ( void *  data,
size_t  size 
) [inline, virtual]

Reads data from the stream.

Reads all requested data from the stream, blocking until all the data has been read, or some error occurs. Errors are signaled by throwing a DashelException exception, which may be caused either by device errors or reaching the end of file.

Parameters:
dataPointer to the memory where the read data should be stored.
sizeAmount of data to read in bytes.

Implements Dashel::Stream.

Reimplemented in Dashel::FileStream, Dashel::StdoutStream, and Dashel::StdinStream.

Definition at line 730 of file dashel-posix.cpp.

If necessary, read a byte and check for disconnection; return true on disconnection, fales otherwise.

Implements Dashel::SelectableStream.

Definition at line 769 of file dashel-posix.cpp.

virtual void Dashel::FileDescriptorStream::write ( const void *  data,
const size_t  size 
) [inline, virtual]

Write data to the stream.

Writes all requested data to the stream, blocking until all the data has been written, or some error occurs. Errors are signaled by throwing a DashelException exception. This function does not flush devices, therefore the data may not really have been written on return, but only been buffered. In order to flush the stream, call flush().

Parameters:
dataPointer to the data to write.
sizeAmount of data to write in bytes.

Implements Dashel::Stream.

Reimplemented in Dashel::FileStream, Dashel::StdoutStream, and Dashel::StdinStream.

Definition at line 686 of file dashel-posix.cpp.


The documentation for this class was generated from the following file:


dashel
Author(s): Stéphane Magnenat
autogenerated on Sun Oct 5 2014 23:46:32