scalestack::network::stream_provider Class Reference
#include <stream.h>
Detailed Description
This is the base class for classes providing streams.
Definition at line 174 of file stream.h.
Constructor & Destructor Documentation
Constructor when the stream was accepted by a listener.
- Parameters:
-
| [in] | handler_service | Handler service the datagram provider is associated with. |
| [in] | stream_service | Stream service the stream provider is associated with. |
| [in] | file_descriptor | File descriptor of the accepted connection. |
Definition at line 47 of file stream.cc.
Constructor when the stream is initiating the connection.
- Parameters:
-
| [in] | handler_service | Handler service the datagram provider is associated with. |
| [in] | stream_service | Stream service the stream provider is associated with. |
| [in] | addresses | List of addresses to use while connecting. |
Definition at line 69 of file stream.cc.
| scalestack::network::stream_provider::~stream_provider |
( |
|
) |
[virtual] |
| scalestack::network::stream_provider::stream_provider |
( |
const stream_provider & |
|
) |
[private] |
Don't allow copying of objects.
Member Function Documentation
| void scalestack::network::stream_provider::started |
( |
void |
|
) |
[virtual] |
| void scalestack::network::stream_provider::shutdown |
( |
void |
|
) |
[inline, virtual] |
| void scalestack::network::stream_provider::timer_expired |
( |
void |
|
) |
[inline, virtual] |
| void scalestack::network::stream_provider::run |
( |
void |
|
) |
[virtual] |
| void scalestack::network::stream_provider::set_file_descriptor |
( |
int |
file_descriptor |
) |
[virtual] |
| void scalestack::network::stream_provider::reconnect |
( |
void |
|
) |
|
| void scalestack::network::stream_provider::consume |
( |
size_t |
size |
) |
|
| size_t scalestack::network::stream_provider::write |
( |
uint8_t * |
buffer, |
|
|
size_t |
size, |
|
|
bool |
flush = false | |
|
) |
| | |
| void scalestack::network::stream_provider::shutdown_write |
( |
void |
|
) |
|
Don't allow assignment of objects.
| void scalestack::network::stream_provider::read_ready |
( |
int |
file_descriptor |
) |
[private, virtual] |
This will read data from the connection into the buffer and call read(). This implements a method in the base class so does not have the _ prefix.
- Parameters:
-
| [in] | file_descriptor | File descriptor to read data on. |
Reimplemented from scalestack::event::handler.
Definition at line 244 of file stream.cc.
| void scalestack::network::stream_provider::write_ready |
( |
int |
file_descriptor |
) |
[private, virtual] |
This flushes any data that was in the buffer and calls write_ready() for derived classes if needed. This implements a method in the base class so does not have the _ prefix.
- Parameters:
-
| [in] | file_descriptor | File descriptor to write data to. |
Reimplemented from scalestack::event::handler.
Definition at line 313 of file stream.cc.
| void scalestack::network::stream_provider::_connect |
( |
void |
|
) |
[private] |
Try connecting to the next entry in the address info list.
Definition at line 341 of file stream.cc.
| void scalestack::network::stream_provider::_consume |
( |
size_t |
size |
) |
[private] |
Perform the read buffer consumption, used by both read_ready() and consume().
- Parameters:
-
| [in] | size | Amount of buffer to consume. |
Definition at line 398 of file stream.cc.
| void scalestack::network::stream_provider::_flush |
( |
void |
|
) |
[private] |
Flush data that is in the write buffer.
Definition at line 426 of file stream.cc.
| size_t scalestack::network::stream_provider::_write |
( |
uint8_t * |
buffer, |
|
|
size_t |
size | |
|
) |
| | [private] |
Write data to connection and handle any errors.
- Parameters:
-
| [in] | buffer | Buffer to write. |
| [in] | size | Size of buffer. |
- Returns:
- Amount of data written.
Definition at line 457 of file stream.cc.
Field Documentation
The documentation for this class was generated from the following files: