Struggling to understand the socket timeout #2337
-
|
We have a 1000ms timeout on socket and then these... I am struggling to properly understand what the socket step means. We are successfully sending the request to the server and the server is definitely actioning the request, though we are NOT receiving the server's response, however the timeout is not a response timeout it is a socket timeout. Many thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
The socket timeout is triggered when there's no activity (no data being sent or recieved) on the connection for the specified duration. With your setup, the socket timeout is 1000ms, which is quite aggressive. Here's what's likely happening:
Your socket timeout (1000ms) is much shorter than your response timeout (10000ms). This means even though you're allowing 10 seconds for the response, the connection will die after just 1 second of inactivity. To fix this, you should increase the socket timeout to be at least equal to your response timeout, or remove it entirely if you don't need it: {
timeout: {
send: 10000,
response: 10000
// Remove socket timeout or set it higher
}
}The issue is almost certainly the socket timeout being too short for your server's response time. |
Beta Was this translation helpful? Give feedback.
The socket timeout is triggered when there's no activity (no data being sent or recieved) on the connection for the specified duration. With your setup, the socket timeout is 1000ms, which is quite aggressive.
Here's what's likely happening:
Your socket timeout (1000ms) is much shorter than your response timeout (10000ms). This means even though you're allowing 10 seconds for the response, the connection will die after just 1 second of i…