Eric Jung / GMMP_mbed_Ethernet_Reinit

Dependents:   ThingPlug_Ethernet_Example

Fork of GMMP_mbed by Eric Jung

Revision:
4:1e04850ce835
Parent:
3:6b4536e1962f
--- 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;