#include <icy/http/connection.h>Inherits:
SocketAdapter
Packet stream wrapper for an HTTP connection.
| Return | Name | Description |
|---|---|---|
PacketStream | Outgoing | The Outgoing stream is responsible for packetizing raw application data into the agreed upon HTTP format and sending it to the peer. |
PacketStream | Incoming | The Incoming stream emits incoming HTTP packets for processing by the application. |
ProgressSignal | IncomingProgress | Fired on download progress. |
ProgressSignal | OutgoingProgress | Fired on upload progress. |
PacketStream OutgoingThe Outgoing stream is responsible for packetizing raw application data into the agreed upon HTTP format and sending it to the peer.
PacketStream IncomingThe Incoming stream emits incoming HTTP packets for processing by the application.
This is useful for example when writing incoming data to a file.
ProgressSignal IncomingProgressFired on download progress.
ProgressSignal OutgoingProgressFired on upload progress.
| Return | Name | Description |
|---|---|---|
ConnectionStream | Creates a ConnectionStream wrapping the given HTTP connection. Wires the Outgoing stream emitter to the connection adapter and registers this stream to receive incoming data from the adapter. | |
ssize_t | send virtual | Send data via the Outgoing stream. |
Connection::Ptr | connection | Return a reference to the underlying connection. |
ConnectionStream(Connection::Ptr connection)Creates a ConnectionStream wrapping the given HTTP connection. Wires the Outgoing stream emitter to the connection adapter and registers this stream to receive incoming data from the adapter.
connection The HTTP connection to wrap.virtual
virtual ssize_t send(const char * data, size_t len, int flags)Send data via the Outgoing stream.
Connection::Ptr connection()Return a reference to the underlying connection.
| Return | Name | Description |
|---|---|---|
Connection::Ptr | _connection |
Connection::Ptr _connection| Return | Name | Description |
|---|---|---|
bool | onSocketRecv virtual | Called when data is received from the socket. Forwards the event to all registered receivers in priority order. |
virtual
virtual bool onSocketRecv(net::Socket & socket, const MutableBuffer & buffer, const net::Address & peerAddress)Called when data is received from the socket. Forwards the event to all registered receivers in priority order.
socket The socket that received data.
buffer The received data buffer.
peerAddress Address of the sender.
true to stop propagation to subsequent receivers.