LineBufferedAdapter

Adapter for connections with a line-based protocol. Splits data stream into delimiter-separated lines.

Constructors

this
this(IConnection next)
Undocumented in source.

Members

Functions

onDisconnect
void onDisconnect(string reason, DisconnectType type)
Undocumented in source. Be warned that the author may not have intended to support it.
onReadData
void onReadData(Data data)

Called when data has been received.

processLine
bool processLine(size_t index)
Undocumented in source. Be warned that the author may not have intended to support it.
send
void send(string line)

Append a line to the send buffer.

Variables

delimiter
string delimiter;

The protocol's line delimiter.

inBuffer
Data inBuffer;

The receive buffer.

maxLength
size_t maxLength;

Maximum line length (0 means unlimited).

Inherited Members

From ConnectionAdapter

next
IConnection next;
Undocumented in source.
state
ConnectionState state [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
send
void send(Data[] data, int priority)

Queue Data for sending.

send
alias send = IConnection.send
Undocumented in source.
disconnect
void disconnect(string reason, DisconnectType type)

Terminate the connection.

onConnect
void onConnect()
Undocumented in source. Be warned that the author may not have intended to support it.
onReadData
void onReadData(Data data)
Undocumented in source. Be warned that the author may not have intended to support it.
onDisconnect
void onDisconnect(string reason, DisconnectType type)
Undocumented in source. Be warned that the author may not have intended to support it.
onBufferFlushed
void onBufferFlushed()
Undocumented in source. Be warned that the author may not have intended to support it.
handleConnect
ConnectHandler handleConnect [@property setter]

Callback for when a connection has been established.

handleReadData
ReadDataHandler handleReadData [@property setter]

Callback setter for when new data is read.

handleDisconnect
DisconnectHandler handleDisconnect [@property setter]

Callback setter for when a connection was closed.

handleBufferFlushed
BufferFlushedHandler handleBufferFlushed [@property setter]

Callback setter for when all queued data has been written.

Meta