# Multiple HTTP Requests - every other one fails

**URL:** <https://forum.sierrawireless.com/t/multiple-http-requests-every-other-one-fails/4184>\
**Category:** Open AT\
**Created:** [February 9, 2010, 4:16pm UTC](https://forum.sierrawireless.com/t/multiple-http-requests-every-other-one-fails/4184 "2010-02-09T16:16:46Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [February 9, 2010, 4:16pm UTC](https://forum.sierrawireless.com/t/multiple-http-requests-every-other-one-fails/4184/1 "2010-02-09T16:16:46Z")

</div>

OS: 6.21;  
WIP: 5.10;  
Firmware: R73a;

> [@Open AT® IP Connectivity Development Guide (WIPlib v5.10)](#):
>
> 9.17 The wip\_close Function
> 
> On a request channel, the wip\_close function closes the channel and makes the session ready for another request. When HTTP1.1 is used this does not close the TCP communication channel, it can be reused if the next request is sent to the same server.

But it doesn’t seem to work!

After making a GET or PUT request, I receive the CEV\_PEER\_CLOSE event, and call wip\_close to, “close the channel and make the session ready for another request” - as the guide says (see above).  
But the next request (GET or PUT) will always fail with CERR\_ABORTED, “channel closed by server”

After this failure, the next request (GET or PUT) will always work!

It looks like the wip\_close is not correctly making the channel ready for another request!

These are the traces at the end of a successful request, on the CEV\_PEER\_CLOSE event:

```auto
wip_close=0
[WIP] closing HTTP_DATA 0x180c43e4
[HTTP] destroy request @ 180c43e4
[WIPEV] WIP_CEV_PEER_CLOSE @ TCPCLIENT 0x180c4684
[req_event] WIP_CEV_PEER_CLOSE
```

In this case, note that only HTTP\_DATA is closed.

And these are the traces at the end of a failed request, on the CEV\_ERROR (CERR\_ABORTED) event:

```auto
wip_close=0
[WIP] closing TCPCLIENT 0x180c4684
[WIP] closing HTTP_DATA 0x180c4964
[HTTP] destroy request @ 180c4964
```

In this case, note that both HTTP\_DATA and TCPCLIENT are closed - and, after this, the next request will work.

The code is the Wavecom WIP HTTP GET sample from the SDK;  
The [WIP] and [WIPEV] and [HTTP] and [req\_event] are internal traces from WIP itself.

So, what’s going wrong here? Why is wip\_close not doing its job?

---

_[View the full topic](https://forum.sierrawireless.com/t/multiple-http-requests-every-other-one-fails/4184)._
