Kitodi
Kitodi
Explore posts from servers
CDCloudflare Developers
Created by Kitodi on 1/30/2024 in #workers-help
TCP Sockets read() function got stuck
Is there a way to handle the timeout when using TCP sockets? When this is called and the server has no response, the Cloudflare Worker get stuck at the read() function. Not confirmed in production, it might also get stuck there.
import { connect } from 'cloudflare:sockets'

connect(...).socket.readable.getReader().read()
import { connect } from 'cloudflare:sockets'

connect(...).socket.readable.getReader().read()
3 replies