1 // 2 // 3 // Copyright 2024 gRPC authors. 4 // 5 // Licensed under the Apache License, Version 2.0 (the "License"); 6 // you may not use this file except in compliance with the License. 7 // You may obtain a copy of the License at 8 // 9 // http://www.apache.org/licenses/LICENSE-2.0 10 // 11 // Unless required by applicable law or agreed to in writing, software 12 // distributed under the License is distributed on an "AS IS" BASIS, 13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 // See the License for the specific language governing permissions and 15 // limitations under the License. 16 // 17 // 18 19 #ifndef GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_SERVER_TRANSPORT_H 20 #define GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_SERVER_TRANSPORT_H 21 22 #include "src/core/ext/transport/chttp2/transport/hpack_encoder.h" 23 #include "src/core/ext/transport/chttp2/transport/hpack_parser.h" 24 #include "src/core/lib/transport/promise_endpoint.h" 25 #include "src/core/lib/transport/transport.h" 26 27 namespace grpc_core { 28 namespace http2 { 29 30 // Experimental : This is just the initial skeleton of class 31 // and it is functions. The code will be written iteratively. 32 // Do not use or edit any of these functions unless you are 33 // familiar with the PH2 project (Moving chttp2 to promises.) 34 // TODO(tjagtap) : [PH2][P3] : Delete this comment when http2 35 // rollout begins 36 class Http2ServerTransport final : public ServerTransport { 37 public: Http2ServerTransport(GRPC_UNUSED PromiseEndpoint endpoint,GRPC_UNUSED const ChannelArgs & args,GRPC_UNUSED std::shared_ptr<grpc_event_engine::experimental::EventEngine> event_engine)38 Http2ServerTransport( 39 GRPC_UNUSED PromiseEndpoint endpoint, GRPC_UNUSED const ChannelArgs& args, 40 GRPC_UNUSED std::shared_ptr<grpc_event_engine::experimental::EventEngine> 41 event_engine) {} ~Http2ServerTransport()42 ~Http2ServerTransport() override {}; 43 filter_stack_transport()44 FilterStackTransport* filter_stack_transport() override { return nullptr; } client_transport()45 ClientTransport* client_transport() override { return nullptr; } server_transport()46 ServerTransport* server_transport() override { return this; } GetTransportName()47 absl::string_view GetTransportName() const override { return "http2"; } 48 SetPollset(grpc_stream *,grpc_pollset *)49 void SetPollset(grpc_stream*, grpc_pollset*) override {} SetPollsetSet(grpc_stream *,grpc_pollset_set *)50 void SetPollsetSet(grpc_stream*, grpc_pollset_set*) override {} 51 52 void SetCallDestination( 53 RefCountedPtr<UnstartedCallDestination> call_destination) override; 54 void PerformOp(grpc_transport_op*) override; 55 56 void Orphan() override; 57 void AbortWithError(); 58 }; 59 60 } // namespace http2 61 } // namespace grpc_core 62 63 #endif // GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_SERVER_TRANSPORT_H 64