| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/quic/test_tools/server_thread.h" | 5 #include "net/tools/quic/test_tools/server_thread.h" |
| 6 | 6 |
| 7 #include "net/quic/test_tools/crypto_test_utils.h" | 7 #include "net/quic/test_tools/crypto_test_utils.h" |
| 8 #include "net/tools/quic/quic_dispatcher.h" | 8 #include "net/tools/quic/quic_dispatcher.h" |
| 9 #include "net/tools/quic/test_tools/quic_server_peer.h" | 9 #include "net/tools/quic/test_tools/quic_server_peer.h" |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 } | 29 } |
| 30 } | 30 } |
| 31 | 31 |
| 32 ServerThread::~ServerThread() {} | 32 ServerThread::~ServerThread() {} |
| 33 | 33 |
| 34 void ServerThread::Initialize() { | 34 void ServerThread::Initialize() { |
| 35 if (initialized_) { | 35 if (initialized_) { |
| 36 return; | 36 return; |
| 37 } | 37 } |
| 38 | 38 |
| 39 server_->Listen(address_); | 39 server_->CreateUDPSocketAndListen(address_); |
| 40 | 40 |
| 41 port_lock_.Acquire(); | 41 port_lock_.Acquire(); |
| 42 port_ = server_->port(); | 42 port_ = server_->port(); |
| 43 port_lock_.Release(); | 43 port_lock_.Release(); |
| 44 | 44 |
| 45 initialized_ = true; | 45 initialized_ = true; |
| 46 } | 46 } |
| 47 | 47 |
| 48 void ServerThread::Run() { | 48 void ServerThread::Run() { |
| 49 if (!initialized_) { | 49 if (!initialized_) { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 return; | 103 return; |
| 104 } | 104 } |
| 105 QuicSession* session = dispatcher->session_map().begin()->second; | 105 QuicSession* session = dispatcher->session_map().begin()->second; |
| 106 if (session->IsCryptoHandshakeConfirmed()) { | 106 if (session->IsCryptoHandshakeConfirmed()) { |
| 107 confirmed_.Signal(); | 107 confirmed_.Signal(); |
| 108 } | 108 } |
| 109 } | 109 } |
| 110 | 110 |
| 111 } // namespace test | 111 } // namespace test |
| 112 } // namespace net | 112 } // namespace net |
| OLD | NEW |