yangyang

Dependents:   espyun espyun

Fork of WIZnetInterface by jiang hao

Revision:
30:6feeaebad180
Parent:
0:6f28332c466f
Child:
31:f6a5f6d1978b
--- a/Socket/TCPSocketConnection.cpp	Tue Nov 17 06:35:55 2015 +0000
+++ b/Socket/TCPSocketConnection.cpp	Fri Nov 04 02:28:28 2016 +0000
@@ -31,16 +31,22 @@
 
 int TCPSocketConnection::connect(const char* host, const int port)
 {
+    Serial pc5(PA_13,PA_14);
+    pc5.baud(115200);
+    pc5.printf("in connect\r\n");
     if (_sock_fd < 0) {
         _sock_fd = eth->new_socket();
         if (_sock_fd < 0) {
+            pc5.printf("in connect 1 return -1\r\n");
             return -1;
         }
     }
     if (set_address(host, port) != 0) {
+  		pc5.printf("in connect 2 return -1\r\n");
         return -1;
     }
-    if (!eth->connect(_sock_fd, get_address(), port)) {
+    if (!eth->connect(_sock_fd, get_address(), port)) {//should jion the timeout
+        pc5.printf("in connect 3 return -1\r\n");
         return -1;
     }
     set_blocking(false);
@@ -52,6 +58,9 @@
 
 bool TCPSocketConnection::is_connected(void)
 {
+    Serial pc2(PA_13,PA_14);
+    pc2.baud(115200);
+    pc2.printf("in is_connected()\r\n");
     // force update recent state.
     _is_connected = eth->is_connected(_sock_fd);
     return _is_connected;