[#Transport-GetBytesToSend]
= xref:Transport.adoc[Transport]::GetBytesToSend
:relfileprefix: ../
:mrdocs:

Get bytes to send on the wire, if any, along with other information about it&period;

== Synopsis

Declared in `&lt;net&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
virtual
xref:Transport/BytesToSend.adoc[BytesToSend]
GetBytesToSend(bool have&lowbar;next&lowbar;message) const noexcept = 0;
----

== Description

As a const function, it does not modify the transport&apos;s observable state, and is thus safe to be called multiple times&period;

Effectively, there are three possible outcomes about whether there are more bytes to send&colon;

* Yes&colon; the transport itself has more bytes to send later&period; For example, for V1Transport this happens during the sending of the header of a message, when there is a non&hyphen;empty payload that follows&period;
* No&colon; the transport itself has no more bytes to send, but will have bytes to send if handed a message through SetMessageToSend&period; In V1Transport this happens when sending the payload of a message&period;
* Blocked&colon; the transport itself has no more bytes to send, and is also incapable of sending anything more at all now, if it were handed another message to send&period; This occurs in V2Transport before the handshake is complete, as the encryption ciphers are not set up for sending messages before that point&period;

The boolean &apos;more&apos; is true for Yes, false for Blocked, and have&lowbar;next&lowbar;message controls what is returned for No&period;

== Return Value

a BytesToSend object&period; The to&lowbar;send member returned acts as a stream which is only ever appended to&period; This means that with the exception of MarkBytesSent (which pops bytes off the front of later to&lowbar;sends), operations on the transport can only append to what is being returned&period; Also note that m&lowbar;type and to&lowbar;send refer to data that is internal to the transport, and calling any non&hyphen;const function on this object may invalidate them&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *have&lowbar;next&lowbar;message* [in]
| If true, the &quot;more&quot; return value reports whether more will be sendable after a SetMessageToSend call&period; It is set by the caller when they know they have another message ready to send, and only care about what happens after that&period; The have&lowbar;next&lowbar;message argument only affects this &quot;more&quot; return value and nothing else&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
