| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <errno.h> | 5 #include <errno.h> |
| 6 #include <fcntl.h> | 6 #include <fcntl.h> |
| 7 #include <netinet/in.h> | 7 #include <netinet/in.h> |
| 8 #include <netinet/tcp.h> | 8 #include <netinet/tcp.h> |
| 9 #include <pthread.h> | 9 #include <pthread.h> |
| 10 #include <signal.h> | 10 #include <signal.h> |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 for (int i = 0; i < g_server_count; i++) | 370 for (int i = 0; i < g_server_count; i++) |
| 371 g_servers[i].DumpInformation(); | 371 g_servers[i].DumpInformation(); |
| 372 } | 372 } |
| 373 | 373 |
| 374 } // namespace | 374 } // namespace |
| 375 | 375 |
| 376 int main(int argc, char** argv) { | 376 int main(int argc, char** argv) { |
| 377 printf("Android device to host TCP forwarder\n"); | 377 printf("Android device to host TCP forwarder\n"); |
| 378 printf("Like 'adb forward' but in the reverse direction\n"); | 378 printf("Like 'adb forward' but in the reverse direction\n"); |
| 379 | 379 |
| 380 CommandLine command_line(argc, argv); | 380 base::CommandLine command_line(argc, argv); |
| 381 CommandLine::StringVector server_args = command_line.GetArgs(); | 381 base::CommandLine::StringVector server_args = command_line.GetArgs(); |
| 382 if (tools::HasHelpSwitch(command_line) || server_args.empty()) { | 382 if (tools::HasHelpSwitch(command_line) || server_args.empty()) { |
| 383 tools::ShowHelp( | 383 tools::ShowHelp( |
| 384 argv[0], | 384 argv[0], |
| 385 "<Device port>[:<Forward to port>:<Forward to address>] ...", | 385 "<Device port>[:<Forward to port>:<Forward to address>] ...", |
| 386 " <Forward to port> default is <Device port>\n" | 386 " <Forward to port> default is <Device port>\n" |
| 387 " <Forward to address> default is 127.0.0.1\n" | 387 " <Forward to address> default is 127.0.0.1\n" |
| 388 "If <Device port> is 0, a port will by dynamically allocated.\n"); | 388 "If <Device port> is 0, a port will by dynamically allocated.\n"); |
| 389 return 0; | 389 return 0; |
| 390 } | 390 } |
| 391 | 391 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 417 for (int i = 0; i < g_server_count; i++) | 417 for (int i = 0; i < g_server_count; i++) |
| 418 g_servers[i].StartThread(); | 418 g_servers[i].StartThread(); |
| 419 for (int i = 0; i < g_server_count; i++) | 419 for (int i = 0; i < g_server_count; i++) |
| 420 g_servers[i].JoinThread(); | 420 g_servers[i].JoinThread(); |
| 421 g_server_count = 0; | 421 g_server_count = 0; |
| 422 delete [] g_servers; | 422 delete [] g_servers; |
| 423 | 423 |
| 424 return 0; | 424 return 0; |
| 425 } | 425 } |
| 426 | 426 |
| OLD | NEW |