public async Task <bool> SendAsync(ReadOnlySequence <byte> messageBytes) { return(await SendThisAsync(messageBytes.Realloc())); async Task <bool> SendThisAsync(ReadOnlySequence <byte> messageBytes) { try { return(await _proxied.SendAsync(PrependTagAndLength(messageBytes))); } catch (Exception e) { _parent.Errored(messageBytes, _proxied, e); return(false); } } }
public async Task <Success> SinkAsync(ReadOnlySequence <byte> messageBytes, IActiveChannel channel) { return(await SinkThisAsync(messageBytes.Realloc(), channel)); async Task <Success> SinkThisAsync(ReadOnlySequence <byte> messageBytes, IActiveChannel channel) { try { var sent = await _external.SendAsync(PrependTagAndLength(messageBytes)); _parent.Responded(messageBytes, channel, _external.Channel, sent); } catch (Exception e) { _parent.Errored(messageBytes, channel, e); } return(Success.Next); } }