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_Ethernet_Example
Fork of GMMP_mbed by
Diff: Network/Network.cpp
- Revision:
- 4:1e04850ce835
- Parent:
- 3:6b4536e1962f
diff -r 6b4536e1962f -r 1e04850ce835 Network/Network.cpp
--- a/Network/Network.cpp	Wed Aug 12 02:13:34 2015 +0000
+++ b/Network/Network.cpp	Wed Aug 12 08:49:45 2015 +0000
@@ -16,8 +16,7 @@
 
 void CloseSocket()
 {
-	if (g_socket <= 0) return;
-
+	if (g_socket <= 0) return;	
 	g_socket = -1;
 	
 	return;
@@ -43,7 +42,7 @@
 		ERR("pClient is NULL!!!");
 		return LIB_PARAM_ERROR;
 	}
-
+	
 //  if (client.connect((char *)szServerIp, g_nServerPort)) {
 	/*
 	if (g_pClient->connect((char *)szServerIp, g_nServerPort)) {
@@ -70,12 +69,20 @@
 		infoln("Connection failed!");
 	} while(retry--);
 
+	// ## 20150812 debug
+	//if(g_pClient->connected()) 
+	//{
+	//	printf("Debug >> Send Hello\r\n");
+	//	g_pClient->write("hello", 6); // data sending success
+	//}
+	
 	return ret;
 }
 
 int WriteTCP(char* pBuf, int nLen)
-{
+{	
 	DBG("WriteTCP(): %d", nLen);
+	INFO("Connection Status = %s", g_pClient->connected() ? "Connected":"Disconnected");
 
 	if (pBuf == NULL || nLen <= 0) return LIB_PARAM_ERROR;
 
    