5#ifndef PT_HTTP_STREAM_H
6#define PT_HTTP_STREAM_H
8#include <Pt/Http/Api.h>
9#include <Pt/Connectable.h>
10#include <Pt/NonCopyable.h>
91 friend class Connection;
92 friend class StreamSession;
105 {
return _connection != 0; }
115 {
return _protocolName; }
162 {
return _inputReady; }
167 {
return _outputReady; }
179 std::string _protocolName;
Connectable()
Default constructor.
Represents a connection between a Signal/Delegate and a slot.
Definition Connection.h:96
Binds one session object to one HTTP stream.
Definition StreamSession.h:54
One HTTP stream on a connection.
Definition Stream.h:90
void cancel()
Cancels a pending transfer of this stream.
StreamSession * session() const
Returns the bound stream session, or null.
Definition Stream.h:109
void setTimeout(std::size_t ms)
Sets the stream timeout in milliseconds.
const std::string & protocol() const
Returns the Upgrade header value.
Definition Stream.h:114
void close()
Ends this stream.
bool isValid() const
Returns true when the connection still owns this stream.
Definition Stream.h:104
Signal & inputReady()
Returns the signal emitted when input is ready.
Definition Stream.h:161
System::EventLoop * loop() const
Returns the event loop of the owning connection.
std::streambuf * buffer()
Returns the stream buffer of the connection.
void beginOutput()
Begins a write of the bytes buffered in buffer().
std::size_t endInput()
Completes the read started by beginInput().
std::size_t endOutput()
Completes the write started by beginOutput().
void beginInput()
Begins a read into the stream buffer.
Signal & outputReady()
Returns the signal emitted when output is ready.
Definition Stream.h:166
NonCopyable()
Default constructor.
Definition NonCopyable.h:63
Multicast Signal to call multiple slots.
Definition Signal.h:190
Event loop of a thread or process.
Definition EventLoop.h:83
HTTP clients and servers.
System programming
Definition Connection.h:26
Core module.
Definition Allocator.h:33