NETSIM  1.0.0
Hardware-in-the-loopacousticnetworksimulator
tcp_client.h
Go to the documentation of this file.
1 // Copyright 2020:
2 // GobySoft, LLC (2017-)
3 // Massachusetts Institute of Technology (2017-)
4 // File authors:
5 // Toby Schneider <toby@gobysoft.org>
6 //
7 //
8 // This file is part of the NETSIM Libraries.
9 //
10 // The NETSIM Libraries are free software: you can redistribute them and/or modify
11 // them under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 2.1 of the License, or
13 // (at your option) any later version.
14 //
15 // The NETSIM Libraries are distributed in the hope that they will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with NETSIM. If not, see <http://www.gnu.org/licenses/>.
22 
23 #ifndef TCP_CLIENT_20180131H
24 #define TCP_CLIENT_20180131H
25 
26 #include "tcp_session.h"
27 
28 namespace netsim
29 {
30 class tcp_client : public tcp_session
31 {
32  public:
33  static std::shared_ptr<tcp_client> create(boost::asio::io_service& io_service);
34 
35  void connect(const std::string& server, unsigned short port);
36 
37  private:
38  tcp_client(boost::asio::io_service& io_service);
39 
40  private:
41  boost::asio::io_service& io_service_;
42 };
43 
44 } // namespace netsim
45 
46 #endif
netsim::tcp_client
Definition: tcp_client.h:30
netsim::tcp_client::connect
void connect(const std::string &server, unsigned short port)
netsim
Definition: environment.h:30
netsim::tcp_client::create
static std::shared_ptr< tcp_client > create(boost::asio::io_service &io_service)
netsim::tcp_session
Definition: tcp_session.h:89
tcp_session.h