sendChunked

This function provides a convenient way to send chunked GELF messages to Graylog. It automatically chunks a message based on packetSizeBytes.

sendChunked
(
Socket socket
,,
uint packetSizeBytes = 8192
,
bool compressed = false
)

Parameters

packetSizeBytes uint

The size of each chunk in bytes. Default : 8192

compressed bool

If true, compress the message using zlib. Default : false

Return Value

Type: auto

void

Throws

Exception if # of chunks > 128.

Examples

auto s = new UdpSocket();
s.connect(new InternetAddress("localhost", 12200));

// Start netcat to watch this packet : `nc -lu 12200`
s.sendChunked(gelfMessage, 500);

Meta