| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <cstdio> | 5 #include <cstdio> |
| 6 #include <cstdlib> | 6 #include <cstdlib> |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/message_loop/message_loop.h" |
| 13 #include "media/cast/test/utility/udp_proxy.h" | 14 #include "media/cast/test/utility/udp_proxy.h" |
| 14 | 15 |
| 15 int main(int argc, char** argv) { | 16 int main(int argc, char** argv) { |
| 16 if (argc < 5) { | 17 if (argc < 5) { |
| 17 fprintf(stderr, | 18 fprintf(stderr, |
| 18 "Usage: udp_proxy <localport> <remotehost> <remoteport> <type>\n" | 19 "Usage: udp_proxy <localport> <remotehost> <remoteport> <type>\n" |
| 19 "Where type is one of: perfect, wifi, evil\n"); | 20 "Where type is one of: perfect, wifi, evil\n"); |
| 20 exit(1); | 21 exit(1); |
| 21 } | 22 } |
| 22 | 23 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 49 exit(1); | 50 exit(1); |
| 50 } | 51 } |
| 51 | 52 |
| 52 printf("Press Ctrl-C when done.\n"); | 53 printf("Press Ctrl-C when done.\n"); |
| 53 scoped_ptr<media::cast::test::UDPProxy> proxy( | 54 scoped_ptr<media::cast::test::UDPProxy> proxy( |
| 54 media::cast::test::UDPProxy::Create(local_endpoint, | 55 media::cast::test::UDPProxy::Create(local_endpoint, |
| 55 remote_endpoint, | 56 remote_endpoint, |
| 56 in_pipe.Pass(), | 57 in_pipe.Pass(), |
| 57 out_pipe.Pass(), | 58 out_pipe.Pass(), |
| 58 NULL)); | 59 NULL)); |
| 59 while (true) { | 60 base::MessageLoop().Run(); // Run forever. |
| 60 sleep(1000); | |
| 61 } | |
| 62 return 1; | 61 return 1; |
| 63 } | 62 } |
| OLD | NEW |