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.
Dependencies: BufferedSerial
Dependents: ThinkSpeak_Test roam_v1 roam_v2 finalv3
Fork of GPRSInterface by
Diff: Socket/TCPSocketConnection.cpp
- Revision:
- 3:acf2ea413e72
- Parent:
- 0:8ccbd963e74d
- Child:
- 4:1142bdd07989
diff -r 8cb3c0d45988 -r acf2ea413e72 Socket/TCPSocketConnection.cpp
--- a/Socket/TCPSocketConnection.cpp Tue Feb 25 06:00:32 2014 +0000
+++ b/Socket/TCPSocketConnection.cpp Wed Feb 26 09:12:46 2014 +0000
@@ -22,10 +22,8 @@
#include "TCPSocketConnection.h"
-static int size;
TCPSocketConnection::TCPSocketConnection()
{
- size = 0;
}
int TCPSocketConnection::connect(const char* host, const int port)
@@ -67,6 +65,7 @@
int TCPSocketConnection::receive(char* data, int length)
{
+#if 0
if (size < 0) {
return -1;
}
@@ -80,7 +79,9 @@
length = size;
size = -1;
}
- return gprs->recv(_sock_fd, data, length);
+#endif
+ int size = gprs->wait_readable(_sock_fd, DEFAULT_TIMEOUT);
+ return gprs->recv(_sock_fd, data, size);
}
int TCPSocketConnection::receive_all(char* data, int length)
