trantor
Non-blocking I/O cross-platform TCP network library, using C++14
Loading...
Searching...
No Matches
trantor::AsyncStream Class Referenceabstract

This class represents a data stream that can be sent asynchronously. The data is sent in chunks, and the chunks are sent in order, and all the chunks are sent continuously. More...

#include <trantor/net/AsyncStream.h>

Inheritance diagram for trantor::AsyncStream:
Collaboration diagram for trantor::AsyncStream:

Public Member Functions

virtual bool send (const char *data, size_t len)=0
 Send data asynchronously.
bool send (const std::string &data)
virtual void close ()=0
 Terminate the stream.

Additional Inherited Members

Protected Member Functions inherited from trantor::NonCopyable
 NonCopyable (const NonCopyable &)=delete
NonCopyable & operator= (const NonCopyable &)=delete
 NonCopyable (NonCopyable &&) noexcept(true)=default
NonCopyable & operator= (NonCopyable &&) noexcept(true)=default

Detailed Description

This class represents a data stream that can be sent asynchronously. The data is sent in chunks, and the chunks are sent in order, and all the chunks are sent continuously.

Member Function Documentation

◆ send()

virtual bool trantor::AsyncStream::send ( const char * data,
size_t len )
pure virtual

Send data asynchronously.

Parameters
dataThe data to be sent
lenThe length of the data
Returns
true if the data is sent successfully or at least is put in the send buffer.
false if the connection is closed.

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