Channel
class Channel : public std::enable_shared_from_this<Channel>
@brief Represents a communication channel used for p2p messaging on a connection to a remote instance. This is only an interface, see TcpChannel for a concrete implementation using the tcp protocol
Functions
| Name | Description |
|---|---|
| readSizeInBytes | Return a pointer to the connection this channels belongs to Return : Synchronously reads the message's size. Will block until a message arrives on the socket. Return : Size in bytes of incoming TCP message |
| consumeBytesAfterReadUntil | ******** ******** Synchronously reads size bytes and return them as a string. |
| read | Synchronously reads size bytes into data. |
| read | This function reads into a vector of chars The reading will block until the data record is read. |
| read | This function reads into a string The reading will block until the data record is read. |
| read | This function reads into a hash. |
| read | ******** ******** Synchronously reads size bytes from socket into data and provides a header. |
| read | This function reads into a header and a vector of chars. |
| read | This function reads into header and a string The reading will block until the data record is read. |
| read | This function reads into a header hash and a data hash. |
| readAsyncSizeInBytes | In case a message arrived, handler will be called back The handler will inform about the number of bytes going to come in handler : Call-back function of signature: void (Channel::Pointer, const size_t&) |
| readAsyncRaw | Asynchronously reads size number of bytes into pre-allocated data buffer A handler can be registered to inform about completion of writing NOTE: This function only makes sense calling after having used "readAsyncSizeInBytes", which gives a chance to correctly pre-allocated memory in user-space. data : Pre-allocated contiguous block of memory size : This number of bytes will be copied into data handler : Call-back function of signature: void (Channel::Pointer) |
| readAsyncStringUntil | Read a string until terminator string is found. |
| readAsyncVector | Asynchronously reads data into a vector |
| readAsyncString | Asynchronously reads data into a string. |
| readAsyncHash | Asynchronously reads data into a hash. |
| readAsyncHashPointer | Asynchronously reads data into a hash. |
| readAsyncVectorPointer | Asynchronously reads data into a vector |
| readAsyncHashVector | Asynchronously reads data into a hash header and a vector |
| readAsyncHashString | Asynchronously reads data into a hash header and a string. |
| readAsyncHashHash | Asynchronously reads data into a hash header and a hash body. |
| readAsyncHashPointerHashPointer | Asynchronously reads data into a hash header and a hash body. |
| readAsyncHashVectorPointer | Asynchronously reads data into a hash header and a vector |
| readAsyncHashVectorBufferSetPointer | Asynchronously reads data into a hash header and into a vector of BufferSet pointers. |
| write | Synchronous write. |
| write | Synchronous write. |
| write | Synchronous write. |
| write | Synchronous write. |
| write | Synchronous write. |
| write | Synchronous write. |
| write | Synchronous write. |
| write | Synchronous write. |
| write | Synchronous write. |
| write | Synchronous write. |
| writeAsyncRaw | Write data asynchronously, i.e. do not block upon call. Upon write completion a handler function is called data : Pointer to a contiguous block of memory that should be written size : This number of bytes will be written handler : to be called upon write completion handler. Needs to be a function wrapped into a std::function which takes const boost::system::error_code& as its only argument. |
| writeAsyncVector | Write data asynchronously, i.e. do not block upon call. Upon write completion a handler function is called data : vector of chars containing the data to be written handler : to be called upon write completion handler. Needs to be a function wrapped into a std::function which takes const boost::system::error_code& as its only argument. |
| writeAsyncVectorPointer | Write data asynchronously, i.e. do not block upon call. Upon write completion a handler function is called data : vector of chars containing the data to be written, passed as a shared pointer handler : to be called upon write completion handler. Needs to be a function wrapped into a std::function which takes const boost::system::error_code& as its only argument. |
| writeAsyncHash | Write data asynchronously, i.e. do not block upon call. Upon write completion a handler function is called data : is contained in a Hash with no particular structure, but serializable, i.e. containing no non-karabo data types or Hash derived types handler : to be called upon write completion handler. Needs to be a function wrapped into a std::function which takes const boost::system::error_code& as its only argument. |
| writeAsyncHashRaw | Write data asynchronously, i.e. do not block upon call. Upon write completion a handler function is called header : containing metadata for the data being written data : Pointer to a contiguous block of memory that should be written size : This number of bytes will be written handler : to be called upon write completion handler. Needs to be a function wrapped into a std::function which takes const boost::system::error_code& as its only argument. |
| writeAsyncHashVector | Write data asynchronously, i.e. do not block upon call. Upon write completion a handler function is called header : containing metadata for the data being written data : vector of chars containing the data to be written handler : to be called upon write completion. Needs to be a function wrapped into a std::function which takes const boost::system::error_code& as its only argument. |
| writeAsyncHashVectorPointer | Write data asynchronously, i.e. do not block upon call. Upon write completion a handler function is called header : containing metadata for the data being written data : vector of chars containing the data to be written, passed as a shared pointer handler : to be called upon write completion handler. Needs to be a function wrapped into a std::function which takes const boost::system::error_code& as its only argument. |
| writeAsyncHashHash | Write data asynchronously, i.e. do not block upon call. Upon write completion a handler function is called header : containing metadata for the data being written body : data contained in a Hash with no particular structure, but serializable, i.e. containing no non-karabo data types or Hash derived types handler : to be called upon write completion. Needs to be a function wrapped into a std::function which takes const boost::system::error_code& as its only argument. |
| writeAsyncHashVectorBufferSetPointer | Write header and vectorheader : containing metadata for the data being written body : data as a vector of BufferSet::Pointer handler : to be called upon write completion. Needs to be a function wrapped into a std::function which takes const boost::system::error_code& as its only argument. |
| dataQuantityRead | Returns the number of bytes read since the last call of this method |
| dataQuantityWritten | Returns the number of bytes written since the last call of this method |
| setTimeoutSyncRead | Set a timeout in when synchronous reads timeout if the haven't been handled milliseconds : |
| writeAsync | Close this channel Check if this channel is open Return : Write data asynchronously, i.e. do not block upon call. Fire and forget, no callback called upon completion data : Pointer to a contiguous block of memory that should be written size : This number of bytes will be written prio : the priority of this write operation |
| writeAsync | Write data asynchronously, i.e. do not block upon call. Fire and forget, no callback called upon completion data : vector of chars containing the data to be written prio : the priority of this write operation |
| writeAsync | Write data asynchronously, i.e. do not block upon call. Fire and forget, no callback called upon completion data : vector of chars containing the data to be written, passed as a shared pointer prio : the priority of this write operation |
| writeAsync | Write data asynchronously, i.e. do not block upon call. Fire and forget, no callback called upon completion data : passed as a string were each character represents one byte of the message prio : the priority of this write operation |
| writeAsync | Write data asynchronously, i.e. do not block upon call. Fire and forget, no callback called upon completion data : is contained in a Hash with no particular structure, but serializable, i.e. containing no non-karabo data types or Hash derived types prio : the priority of this write operation copyAllData : When false, raw data (ByteArray) inside an NDArray won't be copied. For other kind of data, the value of this flag is ignored and a copy will take place. |
| writeAsync | Write data asynchronously, i.e. do not block upon call. Fire and forget, no callback called upon completion data : Pointer to a contiguous block of memory that should be written header : containing metadata for the data being written size : This number of bytes will be written prio : the priority of this write operation |
| writeAsync | Write data asynchronously, i.e. do not block upon call. Fire and forget, no callback called upon completion header : containing metadata for the data being written data : vector of chars containing the data to be written prio : the priority of this write operation |
| writeAsync | Write data asynchronously, i.e. do not block upon call. Fire and forget, no callback called upon completion header : containing metadata for the data being written data : vector of chars containing the data to be written, passed as a shared pointer prio : the priority of this write operation |
| writeAsync | Write data asynchronously, i.e. do not block upon call. Fire and forget, no callback called upon completion header : containing metadata for the data being written data : passed as a string were each character represents one byte of the message prio : the priority of this write operation |
| writeAsync | Write data asynchronously, i.e. do not block upon call. Fire and forget, no callback called upon completion header : containing metadata for the data being written data : is contained in a Hash with no particular structure, but serializable, i.e. containing no non-karabo data types or Hash derived types prio : the priority of this write operation. copyAllData : When false, raw data (ByteArray) inside an NDArray won't be copied. For other kind of data, the value of this flag is ignored and a copy will take place. |
| setAsyncChannelPolicy | Set the policy of how data is queue on this channel for the queue of the given priority. |
Function Details
consumeBytesAfterReadUntil
virtual std::string consumeBytesAfterReadUntil(const size_t nBytes)
Synchronously reads size bytes and return them as a string. The reading will block until the bytes are read.
size
: This number of bytes will be copied into data
Note
reads up nBytes expecting no header. To be used ONLY after a readAsyncStringUntil operation in case some bytes must be read after readAsyncStringUntil has been used.
dataQuantityRead
virtual size_t dataQuantityRead()
Returns the number of bytes read since the last call of this method
dataQuantityWritten
virtual size_t dataQuantityWritten()
Returns the number of bytes written since the last call of this method
read
virtual void read(char* data, const size_t& size)
Synchronously reads size bytes into data. The reading will block until the data record is read.
data
: Pre-allocated contiguous block of memory
size
: This number of bytes will be copied into data
virtual void read(std::vector<char>& data)
This function reads into a vector of chars The reading will block until the data record is read.
data
: A vector which will be updated accordingly
virtual void read(std::string& data)
This function reads into a string The reading will block until the data record is read. CAVEAT: As string is not guaranteed to be represented by a contiguous block of memory this function will always introduce a copy under the hood.
data
: A string which will be updated accordingly
virtual void read(karabo::data::Hash& data)
This function reads into a hash. The reading will block until the data record is read. The reading will block until the data record is read.
data
: Hash object which will be updated
virtual void read(karabo::data::Hash& header, char* data, const size_t& size)
***********************************************************
***********************************************************
Synchronously reads size bytes from socket into data and provides a header. The reading will block until the data record is read.
header
: Hash object which will be updated to contain header information
data
: Pre-allocated contiguous block of memory
size
: This number of bytes will be copied into data
virtual void read(karabo::data::Hash& header, std::vector<char>& data)
This function reads into a header and a vector of chars. The reading will block until the data record is read.
header
: Hash object which will be updated to contain header information
data
: A vector which will be updated accordingly
virtual void read(karabo::data::Hash& header, std::string& data)
This function reads into header and a string The reading will block until the data record is read. CAVEAT: As string is not guaranteed to be represented by a contiguous block of memory this function will always introduce a copy under the hood.
data
: A string which will be updated accordingly
virtual void read(karabo::data::Hash& header, karabo::data::Hash& data)
This function reads into a header hash and a data hash. The reading will block until the data record is read. The reading will block until the data record is read.
header
: Hash object which will be updated to contain header information
data
: Hash object which will be updated to contain data information
readAsyncHash
virtual void readAsyncHash(const ReadHashHandler& handler)
Asynchronously reads data into a hash. All memory management is done by the API.
handler
: Call-function of signature: void (Channel::Pointer, const karabo::data::Hash&)
readAsyncHashHash
virtual void readAsyncHashHash(const ReadHashHashHandler& handler)
Asynchronously reads data into a hash header and a hash body. All memory management is done by the API.
handler
: Call-function of signature: void (const ErrorCode&, const karabo::data::Hash&, const
karabo::data::Hash&)
readAsyncHashPointer
virtual void readAsyncHashPointer(const ReadHashPointerHandler& handler)
Asynchronously reads data into a hash. All memory management is done by the API.
handler
: Call-function of signature: void (Channel::Pointer, const karabo::data::Hash&)
readAsyncHashPointerHashPointer
virtual void readAsyncHashPointerHashPointer(const ReadHashPointerHashPointerHandler& handler)
Asynchronously reads data into a hash header and a hash body. All memory management is done by the API.
handler
: Call-function of signature: void (const ErrorCode&, const karabo::data::Hash&, const
karabo::data::Hash&)
readAsyncHashString
virtual void readAsyncHashString(const ReadHashStringHandler& handler)
Asynchronously reads data into a hash header and a string. All memory management is done by the API. NOTE: A string in general is not storing data contiguously. Thus, an additional copy under the hood is needed which makes this interface slightly slower.
handler
: Call-function of signature: void (Channel::Pointer, const karabo::data::Hash&, const
std::string&)
readAsyncHashVector
virtual void readAsyncHashVector(const ReadHashVectorHandler& handler)
Asynchronously reads data into a hash header and a vector
handler
: Call-function of signature: void (Channel::Pointer, const karabo::data::Hash&, const
std::vector
readAsyncHashVectorBufferSetPointer
virtual void readAsyncHashVectorBufferSetPointer(const ReadHashVectorBufferSetPointerHandler& handler)
Asynchronously reads data into a hash header and into a vector of BufferSet pointers. All memory management is done by the API.
handler
: Call-function of signature:
void (const ErrorCode&, const karabo::data::Hash&, const std::vector
readAsyncHashVectorPointer
virtual void readAsyncHashVectorPointer(const ReadHashVectorPointerHandler& handler)
Asynchronously reads data into a hash header and a vector
handler
: Call-function of signature: void (const ErrorCode&, const karabo::data::Hash&, const
std::vector
readAsyncRaw
virtual void readAsyncRaw(char* data, const size_t& size, const ReadRawHandler& handler)
Asynchronously reads size number of bytes into pre-allocated data buffer A handler can be registered to inform about completion of writing NOTE: This function only makes sense calling after having used "readAsyncSizeInBytes", which gives a chance to correctly pre-allocated memory in user-space.
data
: Pre-allocated contiguous block of memory
size
: This number of bytes will be copied into data
handler
: Call-back function of signature: void (Channel::Pointer)
readAsyncSizeInBytes
virtual void readAsyncSizeInBytes(const ReadSizeInBytesHandler& handler)
In case a message arrived, handler will be called back The handler will inform about the number of bytes going to come in
handler
: Call-back function of signature: void (Channel::Pointer, const size_t&)
readAsyncString
virtual void readAsyncString(const ReadStringHandler& handler)
Asynchronously reads data into a string. All memory management is done by the API. NOTE: A string in general is not storing data contiguously. Thus, an additional copy under the hood is needed which makes this interface slightly slower.
handler
: Call-function of signature: void (Channel::Pointer, const std::string&)
readAsyncStringUntil
virtual void readAsyncStringUntil(const std::string& terminator, const ReadStringHandler& handler)
Read a string until terminator string is found. (No header is expected).
terminator
: when this string found, read is done
handler
: handler with signature ReadStringHandler,
i.e. void (const boost::system::error_code&, std::string&) is called.
second handler parameter is the read string with terminator stripped away
readAsyncVector
virtual void readAsyncVector(const ReadVectorHandler& handler)
Asynchronously reads data into a vector
handler
: Call-function of signature: void (Channel::Pointer, const std::vector
readAsyncVectorPointer
virtual void readAsyncVectorPointer(const ReadVectorPointerHandler& handler)
Asynchronously reads data into a vector
handler
: Call-function of signature: void (Channel::Pointer, const std::vector
readSizeInBytes
virtual size_t readSizeInBytes()
Return a pointer to the connection this channels belongs to
Return : Synchronously reads the message's size. Will block until a message arrives on the socket.
Return : Size in bytes of incoming TCP message
setAsyncChannelPolicy
virtual void setAsyncChannelPolicy(int priority, const std::string& new_policy, const size_t capacity = 0)
Set the policy of how data is queue on this channel for the queue of the given priority. Policies are:
- "LOSSLESS": all data is queue and the queue increases in size within incoming data
- "REJECT_NEWEST": if the queue's fixed capacity is reached new data is rejected
- "REMOVE_OLDEST": if the queue's fixed capacity is the oldest data is rejected
NOTE: This method can potentially modify the capacity of a queue which is in use! This is undefined behavior. Users are encouraged to only call this method when intializing a Channel object instance.
priority
: of the queue to set the policy for
policy
: to set for this queue
capacity
: is an optional capacity for the queue
setTimeoutSyncRead
virtual void setTimeoutSyncRead(int milliseconds)
Set a timeout in when synchronous reads timeout if the haven't been handled
milliseconds
:
write
virtual void write(const char* data, const size_t& size)
Synchronous write. The function blocks until all bytes are written.
data
: Pointer to a contiguous block of memory that should be written
size
: This number of bytes will be written
virtual void write(const std::vector<char>& data)
Synchronous write. The function blocks until all bytes are written.
data
: vector of chars containing the data to be written
virtual void write(const std::string& data)
Synchronous write. The function blocks until all bytes are written.
data
: string, where each character represents on byte of data to be written
virtual void write(const karabo::data::Hash& data)
Synchronous write. The function blocks until all bytes are written.
data
: is contained in a Hash with no particular structure, but serializable, i.e. containing no
non-karabo data types or Hash derived types
virtual void write(const karabo::data::Hash& header, const char* data, const size_t& size)
Synchronous write. The function blocks until all bytes are written.
header
: containing metadata for the data being written
data
: Pointer to a contiguous block of memory that should be written
size
: This number of bytes will be written
virtual void write(const karabo::data::Hash& header, const std::vector<char>& data)
Synchronous write. The function blocks until all bytes are written.
header
: containing metadata for the data being written
data
: vector of chars containing the data to be written
virtual void write(const karabo::data::Hash& header, const std::vector<karabo::data::BufferSet::Pointer>& body)
Synchronous write. The function blocks until all bytes are written.
header
: containing metadata for the data being written and BufferSet's layout
body
: vector of BufferSet pointers
virtual void write(const karabo::data::Hash& header, std::shared_ptr<const std::vector<char> >& data)
Synchronous write. The function blocks until all bytes are written.
header
: containing metadata for the data being written
data
: vector of chars containing the data to be written, passed as a shared pointer
virtual void write(const karabo::data::Hash& header, const std::string& data)
Synchronous write. The function blocks until all bytes are written.
header
: containing metadata for the data being written
data
: string, where each character represents on byte of data to be written
virtual void write(const karabo::data::Hash& header, const karabo::data::Hash& body)
Synchronous write. The function blocks until all bytes are written.
header
: containing metadata for the data being written
data
: is contained in a Hash with no particular structure, but serializable, i.e. containing no
non-karabo data types or Hash derived types
writeAsync
virtual void writeAsync(const char* data, const size_t& size, int prio = 4)
Close this channel Check if this channel is open
Return : Write data asynchronously, i.e. do not block upon call. Fire and forget, no callback called upon completion
data
: Pointer to a contiguous block of memory that should be written
size
: This number of bytes will be written
prio
: the priority of this write operation
virtual void writeAsync(const std::vector<char>& data, int prio = 4)
Write data asynchronously, i.e. do not block upon call. Fire and forget, no callback called upon completion
data
: vector of chars containing the data to be written
prio
: the priority of this write operation
virtual void writeAsync(const std::shared_ptr<std::vector<char> >& data, int prio = 4)
Write data asynchronously, i.e. do not block upon call. Fire and forget, no callback called upon completion
data
: vector of chars containing the data to be written, passed as a shared pointer
prio
: the priority of this write operation
virtual void writeAsync(const std::string& data, int prio = 4)
Write data asynchronously, i.e. do not block upon call. Fire and forget, no callback called upon completion
data
: passed as a string were each character represents one byte of the message
prio
: the priority of this write operation
virtual void writeAsync(const karabo::data::Hash& data, int prio = 4, bool copyAllData = true)
Write data asynchronously, i.e. do not block upon call. Fire and forget, no callback called upon completion
data
: is contained in a Hash with no particular structure, but serializable, i.e. containing no
non-karabo data types or Hash derived types
prio
: the priority of this write operation
copyAllData
: When false, raw data (ByteArray) inside an NDArray won't be copied. For other kind of
data, the value of this flag is ignored and a copy will take place.
virtual void writeAsync(const karabo::data::Hash& header, const char* data, const size_t& size, int prio = 4)
Write data asynchronously, i.e. do not block upon call. Fire and forget, no callback called upon completion
data
: Pointer to a contiguous block of memory that should be written
header
: containing metadata for the data being written
size
: This number of bytes will be written
prio
: the priority of this write operation
virtual void writeAsync(const karabo::data::Hash& header, const std::vector<char>& data, int prio = 4)
Write data asynchronously, i.e. do not block upon call. Fire and forget, no callback called upon completion
header
: containing metadata for the data being written
data
: vector of chars containing the data to be written
prio
: the priority of this write operation
virtual void writeAsync(const karabo::data::Hash& header, const std::shared_ptr<std::vector<char> >& data, int prio = 4)
Write data asynchronously, i.e. do not block upon call. Fire and forget, no callback called upon completion
header
: containing metadata for the data being written
data
: vector of chars containing the data to be written, passed as a shared pointer
prio
: the priority of this write operation
virtual void writeAsync(const karabo::data::Hash& header, const std::string& data, int prio = 4)
Write data asynchronously, i.e. do not block upon call. Fire and forget, no callback called upon completion
header
: containing metadata for the data being written
data
: passed as a string were each character represents one byte of the message
prio
: the priority of this write operation
virtual void writeAsync(const karabo::data::Hash& header, const karabo::data::Hash& data, int prio = 4, bool copyAllData = true)
Write data asynchronously, i.e. do not block upon call. Fire and forget, no callback called upon completion
header
: containing metadata for the data being written
data
: is contained in a Hash with no particular structure, but serializable, i.e. containing no
non-karabo data types or Hash derived types
prio
: the priority of this write operation.
copyAllData
: When false, raw data (ByteArray) inside an NDArray won't be copied. For other kind of
data, the value of this flag is ignored and a copy will take place.
writeAsyncHash
virtual void writeAsyncHash(const karabo::data::Hash& data, const WriteCompleteHandler& handler)
Write data asynchronously, i.e. do not block upon call. Upon write completion a handler function is called
data
: is contained in a Hash with no particular structure, but serializable, i.e. containing no
non-karabo data types or Hash derived types
handler
: to be called upon write completion handler. Needs to be a function wrapped into a
std::function which takes const boost::system::error_code& as its only argument.
writeAsyncHashHash
virtual void writeAsyncHashHash(const karabo::data::Hash& header, const karabo::data::Hash& data, const WriteCompleteHandler& handler)
Write data asynchronously, i.e. do not block upon call. Upon write completion a handler function is called
header
: containing metadata for the data being written
body
: data contained in a Hash with no particular structure, but serializable, i.e. containing no
non-karabo data types or Hash derived types
handler
: to be called upon write completion. Needs to be a function wrapped into a
std::function which takes const boost::system::error_code& as its only argument.
writeAsyncHashRaw
virtual void writeAsyncHashRaw(const karabo::data::Hash& header, const char* data, const size_t& size, const WriteCompleteHandler& handler)
Write data asynchronously, i.e. do not block upon call. Upon write completion a handler function is called
header
: containing metadata for the data being written
data
: Pointer to a contiguous block of memory that should be written
size
: This number of bytes will be written
handler
: to be called upon write completion handler. Needs to be a function wrapped into a
std::function which takes const boost::system::error_code& as its only argument.
writeAsyncHashVector
virtual void writeAsyncHashVector(const karabo::data::Hash& header, const std::vector<char>& data, const WriteCompleteHandler& handler)
Write data asynchronously, i.e. do not block upon call. Upon write completion a handler function is called
header
: containing metadata for the data being written
data
: vector of chars containing the data to be written
handler
: to be called upon write completion. Needs to be a function wrapped into a
std::function which takes const boost::system::error_code& as its only argument.
writeAsyncHashVectorBufferSetPointer
virtual void writeAsyncHashVectorBufferSetPointer(const karabo::data::Hash& header, const std::vector<karabo::data::BufferSet::Pointer>& body, const WriteCompleteHandler& handler)
Write header and vector
Upon write completion a handler function is called. Data inside the buffers must not be changed or deleted before this handler is called. Special care is needed if any Hash that had been serialised into the buffers contained an NDArray: The raw data of the array will be shared between the BufferSet and the Hash. Deletion of the Hash is safe, though.
header
: containing metadata for the data being written
body
: data as a vector of BufferSet::Pointer
handler
: to be called upon write completion. Needs to be a function wrapped into a
std::function which takes const boost::system::error_code& as its only argument.
writeAsyncHashVectorPointer
virtual void writeAsyncHashVectorPointer(const karabo::data::Hash& header, const std::shared_ptr<std::vector<char> >& data, const WriteCompleteHandler& handler)
Write data asynchronously, i.e. do not block upon call. Upon write completion a handler function is called
header
: containing metadata for the data being written
data
: vector of chars containing the data to be written, passed as a shared pointer
handler
: to be called upon write completion handler. Needs to be a function wrapped into a
std::function which takes const boost::system::error_code& as its only argument.
writeAsyncRaw
virtual void writeAsyncRaw(const char* data, const size_t& size, const WriteCompleteHandler& handler)
Write data asynchronously, i.e. do not block upon call. Upon write completion a handler function is called
data
: Pointer to a contiguous block of memory that should be written
size
: This number of bytes will be written
handler
: to be called upon write completion handler. Needs to be a function wrapped into a
std::function which takes const boost::system::error_code& as its only argument.
writeAsyncVector
virtual void writeAsyncVector(const std::vector<char>& data, const WriteCompleteHandler& handler)
Write data asynchronously, i.e. do not block upon call. Upon write completion a handler function is called
data
: vector of chars containing the data to be written
handler
: to be called upon write completion handler. Needs to be a function wrapped into a
std::function which takes const boost::system::error_code& as its only argument.
writeAsyncVectorPointer
virtual void writeAsyncVectorPointer(const std::shared_ptr<std::vector<char> >& data, const WriteCompleteHandler& handler)
Write data asynchronously, i.e. do not block upon call. Upon write completion a handler function is called
data
: vector of chars containing the data to be written, passed as a shared pointer
handler
: to be called upon write completion handler. Needs to be a function wrapped into a
std::function which takes const boost::system::error_code& as its only argument.