ngtcp2_conn_write_aggregate_pkt
Synopsis
#include <ngtcp2/ngtcp2.h>
-
ngtcp2_ssize ngtcp2_conn_write_aggregate_pkt(ngtcp2_conn *conn, ngtcp2_path *path, ngtcp2_pkt_info *pi, uint8_t *buf, size_t buflen, size_t *pgsolen, ngtcp2_write_pkt write_pkt, ngtcp2_tstamp ts)
ngtcp2_conn_write_aggregate_pkt()
is a helper function to write multiple packets in the provided buffer, which is suitable to be sent at once in GSO. This function returns the number of bytes written to the buffer pointed by buf of length buflen. buflen must be at leastngtcp2_conn_get_path_max_tx_udp_payload_size(conn)
bytes long. It is recommended to pass the buffer at leastngtcp2_conn_get_max_tx_udp_payload_size(conn)
bytes in order to send a PMTUD packet. This function only writes multiple packets if the first packet isngtcp2_conn_get_path_max_tx_udp_payload_size(conn)
bytes long. The application can adjust the length of the buffer to limit the number of packets to aggregate. If this function returns positive integer, all packets share the samengtcp2_path
andngtcp2_pkt_info
values, and they are assigned to the objects pointed by path and pi respectively. The length of all packets other than the last packet is assigned to *pgsolen. The length of last packet is equal to or less than *pgsolen. write_pkt must write a single packet. After all packets are written, this function callsngtcp2_conn_update_pkt_tx_time()
.This function returns the number of bytes written to the buffer, or a negative error code returned by write_pkt.
This function has been available since v1.15.0.