The C and C++ Include Header Files
/usr/include/nodejs/src/inspector_socket.h
$ cat -n /usr/include/nodejs/src/inspector_socket.h 1 #ifndef SRC_INSPECTOR_SOCKET_H_ 2 #define SRC_INSPECTOR_SOCKET_H_ 3 4 #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS 5 6 #include "util.h" 7 #include "uv.h" 8 9 #include
10 #include
11 12 namespace node { 13 namespace inspector { 14 15 class ProtocolHandler; 16 17 // HTTP Wrapper around a uv_tcp_t 18 class InspectorSocket { 19 public: 20 class Delegate { 21 public: 22 virtual void OnHttpGet(const std::string& host, 23 const std::string& path) = 0; 24 virtual void OnSocketUpgrade(const std::string& host, 25 const std::string& path, 26 const std::string& accept_key) = 0; 27 virtual void OnWsFrame(const std::vector
& frame) = 0; 28 virtual ~Delegate() = default; 29 }; 30 31 using DelegatePointer = std::unique_ptr
; 32 using Pointer = std::unique_ptr
; 33 34 static Pointer Accept(uv_stream_t* server, DelegatePointer delegate); 35 36 ~InspectorSocket(); 37 38 void AcceptUpgrade(const std::string& accept_key); 39 void CancelHandshake(); 40 void Write(const char* data, size_t len); 41 void SwitchProtocol(ProtocolHandler* handler); 42 std::string GetHost(); 43 44 InspectorSocket(const InspectorSocket&) = delete; 45 InspectorSocket& operator=(const InspectorSocket&) = delete; 46 47 private: 48 static void Shutdown(ProtocolHandler*); 49 InspectorSocket() = default; 50 51 DeleteFnPtr
protocol_handler_; 52 }; 53 54 55 } // namespace inspector 56 } // namespace node 57 58 #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS 59 60 #endif // SRC_INSPECTOR_SOCKET_H_
Contact us
|
About us
|
Term of use
|
Copyright © 2000-2024 MyWebUniversity.com ™