aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/bun.js')
-rw-r--r--src/bun.js/api/bun/socket.zig15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/bun.js/api/bun/socket.zig b/src/bun.js/api/bun/socket.zig
index a8c0948d9..752adea1e 100644
--- a/src/bun.js/api/bun/socket.zig
+++ b/src/bun.js/api/bun/socket.zig
@@ -771,7 +771,7 @@ pub const Listener = struct {
Socket.dataSetCached(this_socket.getThisValue(globalObject), globalObject, default_data);
}
socket.ext(**anyopaque).?.* = bun.cast(**anyopaque, this_socket);
- socket.timeout(120000);
+ socket.setTimeout(120000);
}
// pub fn addServerName(this: *Listener, _: *JSC.JSGlobalObject, _: *JSC.CallFrame) callconv(.C) JSValue {
@@ -1599,7 +1599,7 @@ fn NewSocket(comptime ssl: bool) type {
return .zero;
}
- this.socket.timeout(@as(c_uint, @intCast(t)));
+ this.socket.setTimeout(@as(c_uint, @intCast(t)));
return JSValue.jsUndefined();
}
@@ -2962,6 +2962,17 @@ pub fn NewWrappedHandler(comptime tls: bool) type {
}
}
+ pub fn onLongTimeout(
+ this: WrappedSocket,
+ socket: Socket,
+ ) void {
+ if (comptime tls) {
+ TLSSocket.onTimeout(this.tls, socket);
+ } else {
+ TLSSocket.onTimeout(this.tcp, socket);
+ }
+ }
+
pub fn onConnectError(
this: WrappedSocket,
socket: Socket,