Hybrid ICN (hICN) plugin  v21.06-rc0-4-g18fa668
socket.h
1 /*
2  * Copyright (c) 2017-2019 Cisco and/or its affiliates.
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 
16 #pragma once
17 
18 #include <core/facade.h>
19 #include <hicn/transport/config.h>
20 #include <hicn/transport/interfaces/callbacks.h>
21 #include <hicn/transport/interfaces/socket_options_default_values.h>
22 #include <hicn/transport/interfaces/socket_options_keys.h>
23 
24 #define SOCKET_OPTION_GET 0
25 #define SOCKET_OPTION_NOT_GET 1
26 #define SOCKET_OPTION_SET 2
27 #define SOCKET_OPTION_NOT_SET 3
28 #define SOCKET_OPTION_DEFAULT 12345
29 
30 namespace transport {
31 namespace implementation {
32 
33 // Forward Declarations
34 class Socket;
35 
36 class Socket {
37  public:
38  virtual void connect() = 0;
39  virtual bool isRunning() = 0;
40 
41  virtual asio::io_service &getIoService() { return portal_->getIoService(); }
42 
43  protected:
44  Socket(std::shared_ptr<core::Portal> &&portal);
45 
46  virtual ~Socket(){};
47 
48  protected:
49  std::shared_ptr<core::Portal> portal_;
50  bool is_async_;
51 };
52 
53 } // namespace implementation
54 
55 } // namespace transport
transport::implementation::Socket
Definition: socket.h:36
transport
Definition: forwarder_config.h:32