# how does Xojo.Net.HTTPSocket manage keep-alive connections?

**URL:** <https://forum.xojo.com/t/how-does-xojo-net-httpsocket-manage-keep-alive-connections/40420>\
**Category:** General\
**Created:** [October 30, 2017, 4:58pm UTC](https://forum.xojo.com/t/how-does-xojo-net-httpsocket-manage-keep-alive-connections/40420 "2017-10-30T16:58:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_Sentman](https://forum.xojo.com/user_avatar/forum.xojo.com/james_sentman/32/742_2.png) [@James\_Sentman](https://forum.xojo.com/u/James_Sentman)\
**Post date:** [October 30, 2017, 4:58pm UTC](https://forum.xojo.com/t/how-does-xojo-net-httpsocket-manage-keep-alive-connections/40420/1 "2017-10-30T16:58:44Z")

</div>

And how can I know if a connection is in progress or if its ready for another request?

I assume (heh) that if the server supports keep-alive then after the response as been sent back to me that the socket will stay open until I close it or some other timeout is reached. If I make additional Send calls after the connection is established and the first request is finished do they go down the same pipe that it kept open? I should call ClearRequestHeaders first though correct?

So how can I tell if the connection is ready for another request or not? Or does HTTP/1.1 support my sending as many requests as I like and it will just queue them up itself and I dont have to worry about waiting for one to finish before I start another? There is some vague references in the docs about a request already in progress type exception, but I dont see that documented in the send method for the xojo.net.httpsocket?

There is a change that the server wont support http/1.1 and Ill have to drop back to 1.0 or that connection-close will be specified in the first return. So what happens in the case of my having queued up several requests at once and then the socket is actually closed. I assume it wont save those up and fire them out one at a time then?

If there was a property to let me know that there is a request in progress that would make it fairly easy to queue up additional requests and push them out after the last one was received, after some non-fatal error was received or timeout. But I dont see that in the documentation either. Do I have to subclass the socket and add that by setting it to true when I do a send and then resetting it when the response is received?

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 6:58pm UTC](https://forum.xojo.com/t/how-does-xojo-net-httpsocket-manage-keep-alive-connections/40420/2 "2020-10-29T18:58:28Z")

</div>


