Function destroy [src]

If this is called without calling flush or end, data will be dropped unsent.

Prototype

pub fn destroy(c: *Connection) void

Parameters

c: *Connection

Source

pub fn destroy(c: *Connection) void { c.getStream().close(); 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(); }, } }