Now can_tcp_win32 default to 127.0.0.1 and can_tcp_win32_server is verbose
authorEdouard Tisserant
Wed, 06 Mar 2013 11:32:27 +0900
changeset 771 4c74be252095
parent 770 4e29238f514c
child 772 7cb6e71d6331
Now can_tcp_win32 default to 127.0.0.1 and can_tcp_win32_server is verbose
drivers/can_tcp_win32/can_tcp_win32.cpp
drivers/can_tcp_win32/can_tcp_win32_server.cpp
--- a/drivers/can_tcp_win32/can_tcp_win32.cpp	Tue Mar 05 20:08:37 2013 +0900
+++ b/drivers/can_tcp_win32/can_tcp_win32.cpp	Wed Mar 06 11:32:27 2013 +0900
@@ -91,10 +91,11 @@
    {
       Socket* s;
       try {
-        s = new SocketClient(board->busname, 11898);
-    
-        //s.SendLine("GET / HTTP/1.0");
-        //s.SendLine("Host: www.google.com");
+        char *dst = "127.0.0.1";
+        if(strlen(board->busname)){
+            dst=board->busname;
+        }
+        s = new SocketClient(dst, 11898);
       } 
       catch (const char* _s) {
         cerr << _s << endl;
--- a/drivers/can_tcp_win32/can_tcp_win32_server.cpp	Tue Mar 05 20:08:37 2013 +0900
+++ b/drivers/can_tcp_win32/can_tcp_win32_server.cpp	Wed Mar 06 11:32:27 2013 +0900
@@ -38,12 +38,11 @@
 
   g_connections.push_back(s);
 
-  //s->SendLine("Welcome to the Message Distributor");
   printf("Accepted new connection (0x%x).\n");
   while (1) {
     std::string r = s->ReceiveLine();
     if (r.empty()) break;
-    //cout << r  << endl;    
+    cout << r  << endl;    
     for (socket_list::iterator os =g_connections.begin();
                                os!=g_connections.end(); 
                                os++) {