MQTTClient

Dependencies:   mbed-http

Revision:
7:c12d2bfe40e2
Parent:
4:9e25b78e0352
Child:
8:f7afec229461
diff -r 734e384f72c3 -r c12d2bfe40e2 MQTTClient.cpp
--- a/MQTTClient.cpp	Wed Mar 21 21:58:35 2012 +0000
+++ b/MQTTClient.cpp	Wed Apr 04 20:59:13 2012 +0000
@@ -206,10 +206,11 @@
     open_session(id);
 
     /*Wait server notice of open sesion*/
+    i = 0;
     while (!sessionOpened) {
         Net::poll();
         wait(1);
-        if (!connected) {
+        if (!connected || ++i >30) {
             break;
         }
         printf("Wait for session..\r\n");