SynchronousHTTPSocket sometimes gets stalled. Is it b/c of the timeout?

I am using SynchronousHTTPSocket with a desktop app posting to a web service. I have one section where I use a While loop from a local SQLite db table to post one record at a time all done in a thread. For show, I have a label displaying the number processed of the total (XX of XX). During some tests today, I noticed the thread would “stall”, and I was wondering if it has to do with the socket’s timeout, which is 60 seconds by default. Couple questions here, and a watered-down snippet of code below

  • Is it true that the socket is attempting the Send call but will stall for the 60 sec timeout? I didn’t wait the full minute to see what would happen as this just occurred to me. I have a note in the code below where I am thinking the stall is occurring
  • If this is just a timeout thing, I could shorten it, but what would be a desirable timeout? Should I choose 15 seconds? 5 seconds? I am displaying a small window for this process for the user so they can see the progress, and I don’t want it to be stalled for a large length of time. If the post does not occur, it’s ok since the data I am having posted is saved to a temp db local table
  • What would happen if it is stalled at the Send line and times out? Does it just say, ok we tried for XX amount of time, and were unsuccessful, so let’s just move onto the next record and continue the loop until the end?
while not rs.AfterLastRow
  try
    Var Socket As New SimpleHTTP.SynchronousHTTPSocket
    Socket.RequestHeader("Cache-Control") = "no-cache"
    Socket.RequestHeader("Connection") = "close"
    
    Var jCode As New JSONItem
    jCode.Value("XXXX") = "XXXX"
    jCode.Value("XXXX") = "XXXX"
    
    dim data as String = jCode.ToString.DefineEncoding(Encodings.UTF8)
    
    Socket.SetRequestContent(data, "application/json")
    
    /// is it getting stuck here b/c the timeout is 60 secs by default?
    Socket.Send("POST", "https://XXXX.XXXX.com/XXXX")
    
    If Socket.LastHTTPStatus = 200 Then
/// also retrieving some data from the web service and then deleting the record from the temp table here if the post was successful
    End if
    
  catch e as RuntimeException
    Return
  end try

/// increase the count for the label
me.AddUserInterfaceUpdate
  rs.MoveToNextRow
wend