tcp_transport.h
Go to the documentation of this file.
1 // Copyright 2019 Fraunhofer IPA
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 #pragma once
16 
18 
19 class TCPTransport : public Transport
20 {
21 public:
22  TCPTransport(std::string address);
23 
24  ~TCPTransport();
25 
26  virtual bool connect();
27  virtual bool disconnect();
28  virtual bool read(boost::array<uint8_t, 4096>& buf, size_t& len);
29  virtual bool readWithTimeout(boost::array<uint8_t, 4096>& buf, size_t& len, const uint32_t expiry_time);
30 
31 private:
32  std::unique_ptr<boost::asio::ip::tcp::socket> socket_;
33 };
TCPTransport::~TCPTransport
~TCPTransport()
Definition: tcp_transport.cpp:14
TCPTransport::readWithTimeout
virtual bool readWithTimeout(boost::array< uint8_t, 4096 > &buf, size_t &len, const uint32_t expiry_time)
Definition: tcp_transport.cpp:66
Transport
Definition: transport.h:23
TCPTransport::disconnect
virtual bool disconnect()
Definition: tcp_transport.cpp:48
TCPTransport::connect
virtual bool connect()
Definition: tcp_transport.cpp:19
TCPTransport::socket_
std::unique_ptr< boost::asio::ip::tcp::socket > socket_
Definition: tcp_transport.h:32
TCPTransport::TCPTransport
TCPTransport(std::string address)
Definition: tcp_transport.cpp:7
TCPTransport
Definition: tcp_transport.h:19
TCPTransport::read
virtual bool read(boost::array< uint8_t, 4096 > &buf, size_t &len)
Definition: tcp_transport.cpp:55
transport.h


pf_driver
Author(s): Harsh Deshpande
autogenerated on Sun Feb 4 2024 03:32:56