Sane C++ Libraries
C++ Platform Abstraction Libraries
SC::ReadableSocketStream Struct Reference

Uses an SC::AsyncFileWrite to stream data from a socket. More...

#include <AsyncRequestStreams.h>

Inheritance diagram for SC::ReadableSocketStream:
SC::AsyncRequestReadableStream< AsyncSocketReceive > SC::AsyncReadableStream

Additional Inherited Members

- Public Member Functions inherited from SC::AsyncRequestReadableStream< AsyncSocketReceive >
Result init (AsyncBuffersPool &buffersPool, Span< Request > requests, AsyncEventLoop &loop, const DescriptorType &descriptor)
 
Result registerAutoCloseDescriptor (bool value)
 Registers or unregisters a listener to AsyncReadableStream::eventEnd to close descriptor. More...
 
- Public Member Functions inherited from SC::AsyncReadableStream
Result init (AsyncBuffersPool &buffersPool, Span< Request > requests)
 Emitted when the underlying resource has been closed. More...
 
Result start ()
 Starts the readable stream, that will emit eventData. More...
 
void pause ()
 Pauses the readable stream (that can be later resumed) More...
 
void resumeReading ()
 Resumes the readable stream paused by AsyncReadableStream::pause. More...
 
void destroy ()
 Forcefully destroys the readable stream before it's end event releasing all resources. More...
 
bool isEnded () const
 Returns true if the stream is ended (AsyncReadableStream::end has been called) More...
 
AsyncBuffersPoolgetBuffersPool ()
 Obtains the AsyncBuffersPool to request more buffers. More...
 
void push (AsyncBufferView::ID bufferID, size_t newSize)
 Use push from inside AsyncReadableStream::asyncRead function to queue received data. More...
 
void pushEnd ()
 Use pushEnd from inside AsyncReadableStream::asyncRead to signal production end. More...
 
void reactivate (bool doReactivate)
 Use reactivate(true) from inside AsyncReadableStream::asyncRead function to ask the state machine to invoke asyncRead again. More...
 
void emitError (Result error)
 Signals an async error received. More...
 
bool getBufferOrPause (size_t minumumSizeInBytes, AsyncBufferView::ID &bufferID, Span< char > &data)
 Returns an unused buffer from pool or pauses the stream if none is available. More...
 
- Public Attributes inherited from SC::AsyncRequestReadableStream< AsyncSocketReceive >
AsyncSocketReceive request
 
- Public Attributes inherited from SC::AsyncReadableStream
Function< Result()> asyncRead
 Function that every stream must define to implement its custom read operation. More...
 
Event< MaxListeners, ResulteventError
 
Event< MaxListeners, AsyncBufferView::IDeventData
 Emitted when an error occurs. More...
 
Event< MaxListeners > eventEnd
 Emitted when a new buffer has been read. More...
 
Event< MaxListeners > eventClose
 Emitted when there is no more data. More...
 
- Static Public Attributes inherited from SC::AsyncReadableStream
static constexpr int MaxListeners = 8
 
- Protected Member Functions inherited from SC::AsyncRequestReadableStream< AsyncSocketReceive >
Result read ()
 
void afterRead (typename AsyncRequestType::Result &result, AsyncBufferView::ID bufferID)
 
void onEndCloseDescriptor ()
 

Detailed Description

Uses an SC::AsyncFileWrite to stream data from a socket.


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