Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: SalesforceInterface df-2014-heroku-thermostat-k64f SalesforceInterface
Fork of HTTPClient by
Revision 35:16f0a44cc53e, committed 2014-09-12
- Comitter:
- ansond
- Date:
- Fri Sep 12 20:36:21 2014 +0000
- Parent:
- 34:7a7e395f8df3
- Child:
- 36:debaeb6006a7
- Commit message:
- updated with thread-safe wait()
Changed in this revision
| HTTPClient.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/HTTPClient.cpp Fri Aug 29 04:47:47 2014 +0000
+++ b/HTTPClient.cpp Fri Sep 12 20:36:21 2014 +0000
@@ -21,6 +21,10 @@
#define MAX_URL_HOSTNAME_LENGTH 128
#define MAX_URL_PATH_LENGTH 128
+// DMA: mbed
+#include "mbed.h"
+#include "rtos.h"
+
//Debug is disabled by default
#if 0
//Enable debug
@@ -70,7 +74,7 @@
for(i=0; i<RECV_RETRY; i++) {
n = m_sock.receive(buf, sz) ;
if(n >= 0)return n ;
- wait(0.2) ;
+ Thread::wait(200) ;
}
ERR("SocketReceive:%d/%d\n", n, sz) ;
return n ;
@@ -80,10 +84,10 @@
{
int n ;
- wait(0.1) ;
+ Thread::wait(100) ;
n = m_sock.send(buf, sz);
if(n > 0) {
- wait(0.3) ;
+ Thread::wait(300) ;
return n ;
} else ERR("SocketSend:%d/%d\n", n, sz);
return n ;
