| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "net/tools/flip_server/flip_config.h" | 5 #include "net/tools/flip_server/flip_config.h" |
| 6 | 6 |
| 7 #include <unistd.h> | 7 #include <unistd.h> |
| 8 | 8 |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "net/tools/flip_server/create_listener.h" | 10 #include "net/tools/flip_server/tcp_socket_util.h" |
| 11 | 11 |
| 12 namespace net { | 12 namespace net { |
| 13 | 13 |
| 14 FlipAcceptor::FlipAcceptor(enum FlipHandlerType flip_handler_type, | 14 FlipAcceptor::FlipAcceptor(enum FlipHandlerType flip_handler_type, |
| 15 std::string listen_ip, | 15 std::string listen_ip, |
| 16 std::string listen_port, | 16 std::string listen_port, |
| 17 std::string ssl_cert_filename, | 17 std::string ssl_cert_filename, |
| 18 std::string ssl_key_filename, | 18 std::string ssl_key_filename, |
| 19 std::string http_server_ip, | 19 std::string http_server_ip, |
| 20 std::string http_server_port, | 20 std::string http_server_port, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 45 ssl_disable_compression_(false), | 45 ssl_disable_compression_(false), |
| 46 idle_socket_timeout_s_(300) { | 46 idle_socket_timeout_s_(300) { |
| 47 VLOG(1) << "Attempting to listen on " << listen_ip_.c_str() << ":" | 47 VLOG(1) << "Attempting to listen on " << listen_ip_.c_str() << ":" |
| 48 << listen_port_.c_str(); | 48 << listen_port_.c_str(); |
| 49 if (!https_server_ip_.size()) | 49 if (!https_server_ip_.size()) |
| 50 https_server_ip_ = http_server_ip_; | 50 https_server_ip_ = http_server_ip_; |
| 51 if (!https_server_port_.size()) | 51 if (!https_server_port_.size()) |
| 52 https_server_port_ = http_server_port_; | 52 https_server_port_ = http_server_port_; |
| 53 | 53 |
| 54 while (1) { | 54 while (1) { |
| 55 int ret = CreateListeningSocket(listen_ip_, | 55 int ret = CreateTCPServerSocket(listen_ip_, |
| 56 listen_port_, | 56 listen_port_, |
| 57 true, | 57 true, |
| 58 accept_backlog_size_, | 58 accept_backlog_size_, |
| 59 true, | 59 true, |
| 60 reuseport, | 60 reuseport, |
| 61 wait_for_iface, | 61 wait_for_iface, |
| 62 disable_nagle_, | 62 disable_nagle_, |
| 63 &listen_fd_); | 63 &listen_fd_); |
| 64 if (ret == 0) { | 64 if (ret == 0) { |
| 65 break; | 65 break; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 spdy_only, | 135 spdy_only, |
| 136 accept_backlog_size, | 136 accept_backlog_size, |
| 137 disable_nagle, | 137 disable_nagle, |
| 138 accepts_per_wake, | 138 accepts_per_wake, |
| 139 reuseport, | 139 reuseport, |
| 140 wait_for_iface, | 140 wait_for_iface, |
| 141 memory_cache)); | 141 memory_cache)); |
| 142 } | 142 } |
| 143 | 143 |
| 144 } // namespace net | 144 } // namespace net |
| OLD | NEW |