Branch data Line data Source code
1 : : // Copyright 2026 HPActor Contributors
2 : : //
3 : : // Licensed under the Apache License, Version 2.0 (the "License");
4 : : // you may not use this file except in compliance with the License.
5 : : // You may obtain a copy of the License at
6 : : //
7 : : // http://www.apache.org/licenses/LICENSE-2.0
8 : : //
9 : : // Unless required by applicable law or agreed to in writing, software
10 : : // distributed under the License is distributed on an "AS IS" BASIS,
11 : : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 : : // See the License for the specific language governing permissions and
13 : : // limitations under the License.
14 : :
15 : : #include <hpactor/net/transport.hpp>
16 : :
17 : : namespace hpactor {
18 : :
19 : : namespace net {
20 : :
21 : 47 : Connection::Connection(int fd, EndPoint local_endpoint,
22 : 47 : EndPoint remote_endpoint, EventLoop* loop)
23 : 47 : : fd_(fd), local_endpoint_(local_endpoint),
24 : 47 : remote_endpoint_(remote_endpoint), loop_(loop) {}
25 : :
26 : 47 : Connection::~Connection() = default;
27 : :
28 : 133 : void Connection::set_state(ConnectionState new_state) {
29 : 133 : state_ = new_state;
30 : 133 : }
31 : :
32 : 0 : void Connection::handle_send_completion(int /*result*/) {
33 : : // Default no-op. Derived classes override to handle
34 : : // send completions from the EventLoop.
35 : 0 : }
36 : :
37 : : } // namespace net
38 : : } // namespace hpactor
|