pub fn destroy(c: *Connection, io: Io) void c: *Connectionio: Io420
421
422
423
424
425
426
427
428
429
430
431
432
433 pub fn destroy(c: *Connection, io: Io) void {
c.stream_reader.stream.close(io);
switch (c.protocol) {
.tls => {
if (disable_tls) unreachable;
const tls: *Tls = @alignCast(@fieldParentPtr("connection", c));
tls.destroy();
},
.plain => {
const plain: *Plain = @alignCast(@fieldParentPtr("connection", c));
plain.destroy();
},
}
}
If this is called without calling
flushorend, data will be dropped unsent.