TcpConnection.onData

void onData(DataCallback callback) @property @trusted

Set the inbound data callback.

Parameters

callbackCallback invoked when data is received. Callback contract: invoked on the event loop thread. The data parameter is borrowed — valid only for the duration of the callback. Does not fire after dispose().