+ if (ev == MG_EV_CLOSE)\r
+ {\r
+ conn->connection = NULL;\r
+ conn->connected = false;\r
+ }\r
+}\r
+\r
+bool\r
+MatrixHttpConnect(\r
+ MatrixHttpConnection * hc)\r
+{ \r
+ //struct mg_connection * c =\r
+ mg_http_connect(&hc->mgr, hc->host, MatrixHttpCallback, hc);\r
+\r
+ while (! hc->connected)\r
+ mg_mgr_poll(&hc->mgr, 1000);\r
+\r
+ return hc->connected;\r