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: ThingPlug_WiFi_Example_2 ThingPlug_Ethernet_Example ThingPlug_Ethernet_Example_temp_V2
Fork of GMMP_2 by
Revision 10:84a748b7d1f6, committed 2015-08-14
- Comitter:
- lesmin
- Date:
- Fri Aug 14 09:11:32 2015 +0000
- Parent:
- 9:68708791efac
- Commit message:
- added TCP retry codes by WIZnet
Changed in this revision
| Network/Network.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Network/Network.cpp Thu Aug 13 07:09:04 2015 +0000
+++ b/Network/Network.cpp Fri Aug 14 09:11:32 2015 +0000
@@ -44,14 +44,23 @@
return LIB_PARAM_ERROR;
}
+ int retry = 5;
+ do {
+ if (retry <= 0) {
+ ret = SERVER_CONNECT_ERROR;
+ break;
+ }
// if (client.connect((char *)szServerIp, g_nServerPort)) {
if (g_pClient->connect((char *)szServerIp, g_nServerPort)) {
infoln("Connected!!");
+ break;
} else {
infoln("connection failed!");
- ret = SERVER_CONNECT_ERROR;
+// ret = SERVER_CONNECT_ERROR;
}
+ } while (retry--);
+
return ret;
}
