| 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 // A toy client, which connects to a specified port and sends QUIC | 5 // A toy client, which connects to a specified port and sends QUIC |
| 6 // request to that endpoint. | 6 // request to that endpoint. |
| 7 | 7 |
| 8 #ifndef NET_TOOLS_QUIC_QUIC_CLIENT_H_ | 8 #ifndef NET_TOOLS_QUIC_QUIC_CLIENT_H_ |
| 9 #define NET_TOOLS_QUIC_QUIC_CLIENT_H_ | 9 #define NET_TOOLS_QUIC_QUIC_CLIENT_H_ |
| 10 | 10 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 void WaitForStreamToClose(QuicStreamId id); | 81 void WaitForStreamToClose(QuicStreamId id); |
| 82 | 82 |
| 83 // Wait for events until the handshake is confirmed. | 83 // Wait for events until the handshake is confirmed. |
| 84 void WaitForCryptoHandshakeConfirmed(); | 84 void WaitForCryptoHandshakeConfirmed(); |
| 85 | 85 |
| 86 // Wait up to 50ms, and handle any events which occur. | 86 // Wait up to 50ms, and handle any events which occur. |
| 87 // Returns true if there are any outstanding requests. | 87 // Returns true if there are any outstanding requests. |
| 88 bool WaitForEvents(); | 88 bool WaitForEvents(); |
| 89 | 89 |
| 90 // From EpollCallbackInterface | 90 // From EpollCallbackInterface |
| 91 virtual void OnRegistration( | 91 virtual void OnRegistration(EpollServer* eps, |
| 92 EpollServer* eps, int fd, int event_mask) OVERRIDE {} | 92 int fd, |
| 93 int event_mask) OVERRIDE {} |
| 93 virtual void OnModification(int fd, int event_mask) OVERRIDE {} | 94 virtual void OnModification(int fd, int event_mask) OVERRIDE {} |
| 94 virtual void OnEvent(int fd, EpollEvent* event) OVERRIDE; | 95 virtual void OnEvent(int fd, EpollEvent* event) OVERRIDE; |
| 95 // |fd_| can be unregistered without the client being disconnected. This | 96 // |fd_| can be unregistered without the client being disconnected. This |
| 96 // happens in b3m QuicProber where we unregister |fd_| to feed in events to | 97 // happens in b3m QuicProber where we unregister |fd_| to feed in events to |
| 97 // the client from the SelectServer. | 98 // the client from the SelectServer. |
| 98 virtual void OnUnregistration(int fd, bool replaced) OVERRIDE {} | 99 virtual void OnUnregistration(int fd, bool replaced) OVERRIDE {} |
| 99 virtual void OnShutdown(EpollServer* eps, int fd) OVERRIDE {} | 100 virtual void OnShutdown(EpollServer* eps, int fd) OVERRIDE {} |
| 100 | 101 |
| 101 // QuicDataStream::Visitor | 102 // QuicDataStream::Visitor |
| 102 virtual void OnClose(QuicDataStream* stream) OVERRIDE; | 103 virtual void OnClose(QuicDataStream* stream) OVERRIDE; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 // when the stream is closed (in OnClose). | 218 // when the stream is closed (in OnClose). |
| 218 bool print_response_; | 219 bool print_response_; |
| 219 | 220 |
| 220 DISALLOW_COPY_AND_ASSIGN(QuicClient); | 221 DISALLOW_COPY_AND_ASSIGN(QuicClient); |
| 221 }; | 222 }; |
| 222 | 223 |
| 223 } // namespace tools | 224 } // namespace tools |
| 224 } // namespace net | 225 } // namespace net |
| 225 | 226 |
| 226 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_H_ | 227 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_H_ |
| OLD | NEW |