StreamWriter

Wraps a Transport.

This exposes $(D_PSYMBOL write()), $(D_PSYMBOL writeEof()), $(D_PSYMBOL canWriteEof()), $(D_PSYMBOL getExtraInfo()) and $(D_PSYMBOL close()). It adds $(D_PSYMBOL drain()) coroutine for waiting for flow control. It also adds a $(D_PSYMBOL transport) property which references the Transport directly.

This class is not thread safe.

Constructors

this
this(EventLoop eventLoop, Transport transport, Protocol protocol, StreamReader streamReader)
Undocumented in source.

Members

Functions

canWriteEof
bool canWriteEof()

Return $(D_KEYWORD true) if the transport supports $(D_PSYMBOL writeEof()), $(D_KEYWORD false) if not. See $(D_PSYMBOL WriteTransport.canWriteEof()).

close
void close()

Close the transport: see $(D_PSYMBOL BaseTransport.close()).

drain
void drain()

Give the write buffer of the underlying transport a chance to be flushed.

getExtraInfo
auto getExtraInfo()

Return optional transport information: see $(D_PSYMBOL BaseTransport.getExtraInfo()).

toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.
write
void write(const(void)[] data)

Write some data bytes to the transport: see $(D_PSYMBOL WriteTransport.write()).

writeEof
void writeEof()

Close the write end of the transport after flushing buffered data: see $(D_PSYMBOL WriteTransport.write_eof()).

Properties

transport
WriteTransport transport [@property getter]

Transport.

Meta