Gracefull close ws socket

This commit is contained in:
Nikolay Govorov
2026-03-16 20:20:47 +00:00
parent 0675c23217
commit 6d0dc6cb1e
3 changed files with 13 additions and 2 deletions

View File

@@ -242,7 +242,10 @@ pub const Client = struct {
fn stop(self: *Client) void {
switch (self.mode) {
.http => {},
.cdp => |*cdp| cdp.browser.env.terminate(),
.cdp => |*cdp| {
cdp.browser.env.terminate();
self.ws.sendClose();
},
}
self.ws.shutdown();
}