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 };
virtual bool readWithTimeout(boost::array< uint8_t, 4096 > &buf, size_t &len, const uint32_t expiry_time)
virtual bool read(boost::array< uint8_t, 4096 > &buf, size_t &len)
TCPTransport(std::string address)
virtual bool connect()
virtual bool disconnect()
std::unique_ptr< boost::asio::ip::tcp::socket > socket_
Definition: tcp_transport.h:32


pf_driver
Author(s): Harsh Deshpande
autogenerated on Fri Feb 24 2023 03:59:35